13.6.9. Macro “modelerbuildSimpleGP.C

13.6.9.1. Objective

This macro is the one described in Example: construction of a simple Kriging model, that creates a simple gaussian process, whose training (utf_4D_train.dat) and testing (utf_4D_test.dat) database can both be found in the document folder of the Uranie installation (${URANIESYS}/share/uranie/docUMENTS).

13.6.9.2. Macro Uranie

    // Load observations
    TDataServer *tdsObs = new TDataServer("tdsObs", "observations");

    tdsObs->fileDataRead("utf_4D_train.dat");

    // Construct the GPBuilder
    TGPBuilder *gpb = new TGPBuilder(tdsObs,            // observations data
                   "x1:x2:x3:x4",     // list of input variables
                   "y",               // output variable
                   "matern3/2");      // name of the correlation function

    // Search for the optimal hyper-parameters
    gpb->findOptimalParameters("ML",            // optimisation criterion
                 100,             // screening design size
                 "neldermead",    // optimisation algorithm
                 500);            // max. number of optimisation iterations

    // Construct the kriging model
    TKriging *krig = gpb->buildGP();

    // Display model information
    krig->printLog();

13.6.9.3. Console

This is the result of the last command:

.*******************************
** TKriging::printLog[]
*******************************
 Input Variables:      x1:x2:x3:x4
 Output Variable:      y
 Deterministic trend:  
 Correlation function: URANIE::Modeler::TMatern32CorrFunction
 Correlation length:   normalised   (not normalised)
                       1.6181e+00 (1.6172e+00 )
                       1.4372e+00 (1.4370e+00 )
                       1.5026e+00 (1.5009e+00 )
                       6.7884e+00 (6.7944e+00 )

 Variance of the gaussian process:      70.8755
 RMSE (by Leave One Out):               0.499108
 Q2:                                    0.849843
*******************************