Gaussian Process
Example 1
Summary: Fits a Gaussian Process model to predict the 'Y' response variable using multiple predictor variables, including interactions between silica, sulfur, and silane in the provided data table.
Code:
// Model
// Open data table
dt = Open("data_table.jmp");
// Model
Gaussian Process(
Y( :Y ),
X( :X1, :X2 )
);
Code Explanation:
- Open data table.
- Define response variable.
- Define predictor variables.
- Fit Gaussian Process model.
Example 2
Summary: Fits a Gaussian Process model to predict CPU Time using Alpha, Beta, Gamma, Algorithm, and Compiler as predictors, with a block size of 50.
Code:
// Model
// Open data table
dt = Open("data_table.jmp");
// Model
Gaussian Process(
Y( :CPU Time ),
X(
:Alpha, :Beta, :Gamma, :Algorithm,
:Compiler
),
Set Correlation Function(
"Gaussian"
),
Fast GASP( 1 ),
Block Size( 50 )
);
Code Explanation:
- Open data table.
- Define model variables.
- Set correlation function.
- Enable fast GASP.
- Specify block size.
Example 3
Summary: Creates a Gaussian Process model using Open() to load data and specifying Y(:Y) and X(:X1, :X2) variables.
Code:
dt under test = Open("data_table.jmp");
obj = Gaussian Process( Y( :Y ), X( :X1, :X2 ) );
Code Explanation:
- Open data table.
- Create Gaussian Process object.
- Set Y variable to :Y.
- Set X variables to :X1, :X2.
Example 4
Summary: Runs the creation and grouping of Gaussian Process objects with cubic correlation functions for jackknife predicted values, utilizing a new column 'Z' to differentiate between groups.
Code:
dt = Open("data_table.jmp");
obj1 = Gaussian Process( Y( :Y ), X( :X1, :X2 ), Set Correlation Function( "Cubic" ) );
obj1 << Save Jackknife Predicted Values;
dt << New Column( "Z", character );
For Each Row( :Z = "A" );
obj2 = Gaussian Process( Y( :Y ), X( :X1, :X2 ), Set Correlation Function( "Cubic" ), By( :Z ) );
obj2 << Save Jackknife Predicted Values;
Code Explanation:
- Open data table.
- Create Gaussian Process object.
- Set correlation function to cubic.
- Save Jackknife predicted values.
- Add new column "Z".
- Assign "A" to all rows in "Z".
- Create another Gaussian Process object.
- Set correlation function to cubic.
- Group by column "Z".
- Save Jackknife predicted values.
Example 5
Summary: Creates and saves jackknife predicted values for a Gaussian Process model, with conditional predictions based on a new column 'Z'.
Code:
ut relative epsilon = 1e-10;
dt = Open("data_table.jmp");
obj1 = Gaussian Process( Y( :Y ), X( :X1, :X2 ), Set Correlation Function( "Cubic" ) );
obj1 << Save Jackknife Predicted Values;
dt << New Column( "Z", character );
For Each Row( :Z = "A" );
obj2 = Gaussian Process( Y( :Y ), X( :X1, :X2 ), Set Correlation Function( "Cubic" ), By( :Z ) );
obj2 << Save Jackknife Predicted Values;
Code Explanation:
- Set relative epsilon.
- Open data table.
- Create Gaussian Process object.
- Save jackknife predicted values.
- Add new column "Z".
- Set all "Z" values to "A".
- Create Gaussian Process object by "Z".
- Save jackknife predicted values.
Example 6
Summary: Fits two Gaussian Process models with local data filters to analyze CPU time and filter compiler or algorithm variables.
Code:
dt = Open("data_table.jmp");
Gaussian_LDF = dt << Gaussian Process(
Y( :CPU Time ),
X( :Alpha, :Beta, :Gamma ),
Set Correlation Function( "Gaussian" ),
Fast GASP( 0 ),
SendToReport( Dispatch( {}, "Model Report", OutlineBox, {Close( 1 )} ) )
);
Gaussian_LDF << Local Data Filter( Add Filter( columns( :Compiler ), Where( :Compiler == "A" ) ) );
text1 = (Report( Gaussian_LDF ) << Parent)[Outline Box( 1 )][Text Box( 1 )] << Get Text;
Gaussian_LDF << Close window;
Gaussian_LDF2 = dt << Gaussian Process(
Y( :CPU Time ),
X( :Alpha, :Beta, :Gamma ),
Set Correlation Function( "Gaussian" ),
Fast GASP( 0 ),
SendToReport( Dispatch( {}, "Model Report", OutlineBox, {Close( 1 )} ) )
);
Gaussian_LDF2 << Local Data Filter(
Add Filter( columns( :Algorithm ), Where( :Algorithm == "Greedy" ), Display( :Algorithm, N Items( 3 ), "List Display" ) )
);
text2 = (Report( Gaussian_LDF2 ) << Parent)[Outline Box( 1 )][Text Box( 1 )] << Get Text;
Code Explanation:
- Open data table.
- Run Gaussian Process model.
- Set response variable.
- Set predictor variables.
- Choose Gaussian correlation function.
- Disable Fast GASP.
- Hide Model Report.
- Add local data filter.
- Filter Compiler column for "A".
- Extract report text.
- Close model window.
- Repeat steps 2-10 for another model.
- Filter Algorithm column for "Greedy".
- Extract report text.
Example 7
Summary: Fits a Gaussian Process model to predict CPU Time based on Alpha, Beta, Gamma, Algorithm, and Compiler variables.
Code:
dt = Open("data_table.jmp");
obj = dt << Gaussian Process(
Y( :CPU Time ),
X( :Alpha, :Beta, :Gamma, :Algorithm, :Compiler ),
Set Correlation Function( "Gaussian" ),
Fast GASP( 1 ),
Block Size( 50 )
);
obj << Save Prediction Formula( 1 );
obj << Save Variance Formula( 1 );
obj << Save Jackknife Predicted Values( 1 );
Code Explanation:
- Open data table.
- Fit Gaussian Process model.
- Specify response variable.
- Define predictor variables.
- Set correlation function.
- Enable Fast GASP.
- Set block size.
- Save prediction formula.
- Save variance formula.
- Save jackknife predicted values.
Example 8
Summary: Fits a Gaussian Process model to predict CPU Time using Alpha, Beta, Gamma, Algorithm, and Compiler as predictors, generating a report with -2*LogLikelihood and warnings.
Code:
dt = Open("data_table.jmp");
obj = dt << Gaussian Process(
Y( :CPU Time ),
X( :Alpha, :Beta, :Gamma, :Algorithm, :Compiler ),
Set Correlation Function( "Gaussian" ),
Fast GASP( 1 ),
Block Size( 50 )
);
rpt = obj << report;
Neg2LL = (rpt[Outline Box( "Model Report" )][Number Col Box( "-2*LogLikelihood" )] << get as matrix)[1];
warning = rpt[Outline Box( "Model Report" )][Text Box( 2 )] << get text;
Code Explanation:
- Open data table;
- Define model parameters.
- Apply Gaussian Process.
- Generate report object.
- Extract -2*LogLikelihood.
- Retrieve warning message.
Example 9
Summary: Fits Gaussian Process models with and without Fast GASP to a data table, retrieving model reports and extracting relevant values and matrices.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Gaussian Process( X( :X, :Y ), Y( :Z ), Estimate Nugget( 1 ), Fast GASP( 1 ) );
rpt1 = obj1 << report;
theta = rpt1[Outline Box( "Model Report" )][Number Col Box( "Theta" )] << get as matrix;
sigma2 = rpt1[Outline Box( "Model Report" )][Number Col Box( "σ²" )] << get as matrix;
fast1 = rpt1[Outline Box( "Model Report" )][Table Box( 1 )] << get as matrix;
fast2 = rpt1[Outline Box( "Model Report" )][Table Box( 2 )] << get as matrix;
obj2 = dt << Gaussian Process( X( :X, :Y ), Y( :Z ), Estimate Nugget( 1 ) );
rpt2 = obj2 << report;
nonfast1 = rpt2[Outline Box( "Model Report" )][Table Box( 1 )] << get as matrix;
nonfast2 = rpt2[Outline Box( "Model Report" )][Table Box( 2 )] << get as matrix;
Code Explanation:
- Open data table;
- Create Gaussian Process model with Fast GASP.
- Retrieve Model Report.
- Extract Theta value as matrix.
- Extract σ² value as matrix.
- Extract first Table Box data as matrix.
- Extract second Table Box data as matrix.
- Create Gaussian Process model without Fast GASP.
- Retrieve Model Report.
- Extract first Table Box data as matrix.
- Extract second Table Box data as matrix.
Example 10
Summary: Creates and analyzes Gaussian Process models with cubic correlation function, saving Jackknife predicted values for multiple scenarios.
Code:
dt = Open("data_table.jmp");
obj1 = Gaussian Process( Y( :Y ), X( :X1, :X2 ), Set Correlation Function( "Cubic" ) );
obj1 << Save Jackknife Predicted Values;
expJPV = Column( "Y Jackknife Predicted Values" ) << get as matrix;
dt << New Column( "Z", character );
For Each Row( :Z = "A" );
obj2 = Gaussian Process( Y( :Y ), X( :X1, :X2 ), Set Correlation Function( "Cubic" ), By( :Z ) );
obj2 << Save Jackknife Predicted Values;
objJPV = Column( "Y Jackknife Predicted Values By Z" ) << get as matrix;
Code Explanation:
- Open data table.
- Create Gaussian Process model.
- Set correlation function to cubic.
- Save Jackknife predicted values.
- Extract Jackknife predicted values.
- Add new column "Z".
- Set all "Z" values to "A".
- Create Gaussian Process model by "Z".
- Set correlation function to cubic.
- Save Jackknife predicted values by "Z".
Example 11
Summary: Creates and analyzes Gaussian Process models with multiple interaction terms, utilizing a By Group feature to segment data by 'Z' values.
Code:
ut relative epsilon = 1e-10;
dt = Open("data_table.jmp");
obj1 = Gaussian Process( Y( :Y ), X( :X1, :X2 ), Set Correlation Function( "Cubic" ) );
obj1 << Save Jackknife Predicted Values;
expJPV = Column( "Y Jackknife Predicted Values" ) << get as matrix;
dt << New Column( "Z", character );
For Each Row( :Z = "A" );
obj2 = Gaussian Process( Y( :Y ), X( :X1, :X2 ), Set Correlation Function( "Cubic" ), By( :Z ) );
obj2 << Save Jackknife Predicted Values;
objJPV = Column( "Y Jackknife Predicted Values By Z" ) << get as matrix;
Code Explanation:
- Define relative epsilon.
- Open data table.
- Create Gaussian Process model.
- Save Jackknife Predicted Values.
- Extract Jackknife Predicted Values.
- Add new column "Z".
- Set "Z" values to "A".
- Create Gaussian Process model by "Z".
- Save Jackknife Predicted Values.
- Extract Jackknife Predicted Values by "Z".
Gaussian Process using Model
Summary: Opens a data table and defines a Gaussian Process model with multiple predictor variables, specifying the response variable Y.
Code:
// Model (GP from DOE)
// Open data table
dt = Open("data_table.jmp");
// Model (GP from DOE)
Gaussian Process(
Y( :Y ),
X(
:log10 Rw, :log10 R, :Tu, :Tl,
:Hu, :Hl, :L, :Kw
)
);
Code Explanation:
- Open data table.
- Define Gaussian Process model.
- Set response variable Y.
- Specify predictor variables X.
- Include log10 Rw in predictors.
- Include log10 R in predictors.
- Include Tu in predictors.
- Include Tl in predictors.
- Include Hu in predictors.
- Include Hl in predictors.
- Include L in predictors.
- Include Kw in predictors.
Gaussian Process using Partition
Summary: Creates three partition objects based on different combinations of variables, and then generates a Gaussian Process object using the Text Explorer platform.
Code:
Open("data_table.jmp");
obj1 = Partition( Y( :weight ), X( :sex ), By( :age ) );
obj2 = Partition( Y( :weight ), X( :sex ), By( :age ) );
obj3 = Partition( Y( :weight ), X( :height, :sex ), By( :age ) );
dt = Open("data_table.jmp");
dt << New Column( "_bycol", Character, Nominal, set values( Repeat( {"A", "B"}, N Rows( dt ) )[1 :: N Rows( dt )] ) );
obj = dt << Gaussian Process( Y( :Y ), X( :X1, :X2 ), By( _bycol ) );
Code Explanation:
- Open data table;
- Create partition object 1.
- Create partition object 2.
- Create partition object 3.
- Open data table;
- Add new column "_bycol".
- Assign values to "_bycol".
- Create Gaussian Process object.
Gaussian Process using New Column
Example 1
Summary: Fits a standard least squares model with multiple effects and generates a profiler plot to visualize the results.
Code:
dt = Open("data_table.jmp");
dt << New Column( "AllMissing" );
obj = Gaussian Process(
Y( :AllMissing ),
X( :X1, :X2 ),
Profiler( 1, Confidence Intervals( 1 ), Desirability Functions( 0 ) ),
Estimate Nugget( 1 ),
Set Correlation Function( "Cubic" )
);
validRef = Is Scriptable( obj );
Code Explanation:
- Open data table.
- Create new column.
- Define Gaussian Process model.
- Set response variable.
- Set predictor variables.
- Enable profiler.
- Include confidence intervals.
- Disable desirability functions.
- Estimate nugget effect.
- Set correlation function.
Example 2
Summary: Fits a standard least squares model with multiple effects and generates a profiler plot using Gaussian Process in JMP.
Code:
ut relative epsilon = 1e-10;
dt = Open("data_table.jmp");
dt << New Column( "AllMissing" );
obj = Gaussian Process(
Y( :AllMissing ),
X( :X1, :X2 ),
Profiler( 1, Confidence Intervals( 1 ), Desirability Functions( 0 ) ),
Estimate Nugget( 1 ),
Set Correlation Function( "Cubic" )
);
validRef = Is Scriptable( obj );
Code Explanation:
- Define relative epsilon.
- Open data table.
- Add new column "AllMissing".
- Create Gaussian Process object.
- Specify Y as "AllMissing".
- Specify X as :X1, :X2.
- Enable Profiler with confidence intervals.
- Disable desirability functions.
- Estimate nugget parameter.
- Set correlation function to "Cubic".
Example 3
Summary: Fits a Gaussian Process model to predict Z2 values based on X and Y predictors, with interactive features for report generation.
Code:
dt = Open("data_table.jmp");
dt << New Column( "Z2", numeric, continuous, formula( :Z * 10 ) );
obj1 = dt << Gaussian Process(
X( :X, :Y ),
Y( :Z2 ),
Estimate Nugget( 1 ),
Fast GASP( 1 ),
Correlation Type( "Gaussian" ),
Set Minimum Theta( 0.0008 )
);
rpt1 = obj1 << report;
theta = rpt1[Outline Box( "Model Report" )][Number Col Box( "Theta" )] << get as matrix;
Code Explanation:
- Open data table.
- Create new column "Z2".
- Fit Gaussian Process model.
- Specify predictors X and Y.
- Use Z2 as response variable.
- Estimate nugget parameter.
- Enable Fast GASP method.
- Set correlation type to Gaussian.
- Define minimum theta value.
- Retrieve model report.
Gaussian Process using If
Example 1
Summary: Estimates and reports Gaussian Process models with Fast GASP and non-Fast GASP, utilizing data from a JMP data table.
Code:
If( Contains( JMP Product Name(), "Pro" ),
b theta = [0.0016, 0.0007];
b sigma2 = [6.72];
dt = Open("data_table.jmp");
obj1 = dt << Gaussian Process( X( :X, :Y ), Y( :Z ), Estimate Nugget( 1 ), Fast GASP( 1 ) );
rpt1 = obj1 << report;
theta = rpt1[Outline Box( "Model Report" )][Number Col Box( "Theta" )] << get as matrix;
sigma2 = rpt1[Outline Box( "Model Report" )][Number Col Box( "σ²" )] << get as matrix;
fast1 = rpt1[Outline Box( "Model Report" )][Table Box( 1 )] << get as matrix;
fast2 = rpt1[Outline Box( "Model Report" )][Table Box( 2 )] << get as matrix;
obj2 = dt << Gaussian Process( X( :X, :Y ), Y( :Z ), Estimate Nugget( 1 ) );
rpt2 = obj2 << report;
nonfast1 = rpt2[Outline Box( "Model Report" )][Table Box( 1 )] << get as matrix;
nonfast2 = rpt2[Outline Box( "Model Report" )][Table Box( 2 )] << get as matrix;
Close( dt, no save );
);
If( Contains( JMP Product Name(), "Pro" ),
b theta = [0.0016, 0.0008];
Random Reset( 4785 );
dt = Open("data_table.jmp");
dt << New Column( "Z2", numeric, continuous, formula( :Z * 10 ) );
obj1 = dt << Gaussian Process(
X( :X, :Y ),
Y( :Z2 ),
Estimate Nugget( 1 ),
Fast GASP( 1 ),
Correlation Type( "Gaussian" ),
Set Minimum Theta( 0.0008 )
);
rpt1 = obj1 << report;
theta = rpt1[Outline Box( "Model Report" )][Number Col Box( "Theta" )] << get as matrix;
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro.
- Set b theta values.
- Set b sigma2 values.
- Open data_table data
- Run Gaussian Process with Fast GASP.
- Extract model report.
- Retrieve Theta values.
- Retrieve σ² values.
- Retrieve Fast GASP tables.
- Run Gaussian Process without Fast GASP.
- Extract model report.
- Retrieve non-Fast GASP tables.
- Close data table.
- Check if JMP Pro again.
- Set new b theta values.
- Reset random seed.
- Open data_table data
- Create new column Z2.
- Run Gaussian Process with Fast GASP.
- Extract model report.
- Retrieve Theta values.
- Close data table.
Example 2
Summary: Executes a Gaussian Process model with profiler to predict CPU time, utilizing data from a JMP data table and configuring input values for new rows.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
Random Reset( 123 );
obj1 = dt << Gaussian Process(
Y( :CPU Time ),
X( :Alpha, :Beta, :Gamma, :Algorithm, :Compiler ),
Set Correlation Function( "Gaussian" ),
Fast GASP( 1 ),
Block Size( 50 )
);
obj1 << Save Prediction Formula( 1 );
obj1 << Save Variance Formula( 1 );
obj1 << Save Jackknife Predicted Values( 1 );
Close( dt, no save );
);
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
Random Reset( 82727 );
obj = dt << Gaussian Process(
Y( :CPU Time ),
X( :Alpha, :Beta, :Gamma, :Algorithm, :Compiler ),
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
Alpha( 0.42, Min( -1 ), Max( 1 ), Lock( 0 ), Show( 1 ) ),
Beta( 0.6, Min( -1 ), Max( 1 ), Lock( 0 ), Show( 1 ) ),
Gamma( 0.52, Min( -1 ), Max( 1 ), Lock( 0 ), Show( 1 ) ),
Algorithm( "Greedy", Lock( 0 ), Show( 1 ) ),
Compiler( "B", Lock( 0 ), Show( 1 ) )
)
),
Set Correlation Function( "Gaussian" ),
Fast GASP( 1 ),
Block Size( 50 )
);
obj << Save Prediction Formula( 1 );
rpt = obj << report;
dt << Add row( 1 );
dt:Alpha[51] = 0.42;
dt:Beta[51] = 0.6;
dt:Gamma[51] = 0.52;
dt:Algorithm[51] = "Greedy";
dt:Compiler[51] = "B";
pred1 = rpt[Outline Box( "Prediction Profiler" )][AxisBox( 1 )][Text Box( 2 )] << get text;
pred2 = (dt:CPU Time Prediction Formula << get values)[51];
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro.
- Open data table.
- Reset random seed.
- Run Gaussian Process model.
- Save prediction formula.
- Save variance formula.
- Save jackknife predicted values.
- Close data table.
- Check if JMP Pro again.
- Open data table.
- Reset random seed.
- Run Gaussian Process model with profiler.
- Save prediction formula.
- Get report.
- Add new row to data table.
- Set input values for new row.
- Get prediction from profiler.
- Get prediction from formula.
- Close data table.
Example 3
Summary: Analyze a data table using Gaussian Process modeling, specifying response and predictor variables, and generating a report.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
Random Reset( 1500 );
dt = Open("data_table.jmp");
dt:Compiler[46 :: 50] = "";
Random Reset( 1500 );
obj1 = dt << Gaussian Process(
Y( :CPU Time ),
X( :Alpha, :Beta, :Gamma, :Algorithm, :Compiler ),
Set Correlation Function( "Gaussian" ),
Fast GASP( 1 ),
Block Size( 50 )
);
rpt1 = obj1 << report;
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro.
- Reset random seed.
- Open data table.
- Clear specific cells.
- Reset random seed again.
- Run Gaussian Process model.
- Specify response variable.
- Define predictor variables.
- Set correlation function.
- Configure Fast GASP.
- Set block size.
- Generate report.
- Close data table without saving.
Gaussian Process using Random Reset
Summary: Runs the definition and execution of a Gaussian Process model to analyze CPU time data, utilizing predictor variables Alpha, Beta, Gamma, Algorithm, and Compiler.
Code:
dt = Open("data_table.jmp");
dt:Compiler[46 :: 50] = "";
Random Reset( 1500 );
obj1 = dt << Gaussian Process(
Y( :CPU Time ),
X( :Alpha, :Beta, :Gamma, :Algorithm, :Compiler ),
Set Correlation Function( "Gaussian" ),
Fast GASP( 1 ),
Block Size( 50 )
);
rpt1 = obj1 << report;
Code Explanation:
- Open data table.
- Clear compiler data.
- Reset random seed.
- Define Gaussian Process model.
- Specify response variable.
- Specify predictor variables.
- Set correlation function.
- Enable fast GASP.
- Set block size.
- Generate report.