Using gaussian process model to generate new realizations for sensitivity analysis

I am trying to use a gaussian process to represent output from a finite element code for use in a sensitivity analysis and eventual calibration of parameters given experimental data.

The FEA model uses 15 input parameters for material properties and experimental variables. I generated 295 LHS samples from the FEA model to use as training data for the GP model. I fit the model by normalizing my training data and modifying the gp-predict.stan code at example-models/gp-predict.stan at master · stan-dev/example-models · GitHub. The resulting GP model accurately predicts out of sample realizations from the simulation in the generated quantities block, but I do get a treedepth warning (<1% exceed a treedepth of 10). This model runs in approximately 12 hours on my machine. (See model1.r and model1.stan; normalized training data is in sim.data.r). In the model x1 is the training data points and y1 is the training data response from the FEA code. x2 is a 16x15 vector of out of sample data points and y2 is the out of sample response from the fit GP model.

While model1 runs slowly, it does run and the results are reasonable. I run into significant issues using this model for larger out of sample data sets and I am looking for advice to improve the code. I am using a fixed GP model at the mean of the hyperparameter samples from model1.stan. I am using the Sensitivity package to generate a matrix of out of sample data points to create sobol indices. The model starts to run, but stalls out during warm-up at approximately 4%. (See model2.r and model2.stan; normalized training data is the same from sim.data.r). In model2, x1 and y1 are the training data points and response, and x2 is a 3842x15 vector of out of sample data points I want to predict using the model. I am using the non-centered parameterization of the GP model and the cov_exp_quad function, so I am not sure what else is making the model so slow to run/not run to completion.

Thanks for any insight you might have!

model1.r (474 Bytes)
model1.stan (1.1 KB)
model2.r (1.5 KB)
model2.stan (1.0 KB)
sim.data.r (105.4 KB)