Description Usage Arguments Value Author(s) References

This function performs the posterior sampling for calibration parameters and other parameters in the model.

1 2 3 | ```
post_sample(input, output, R0_list, kernel_type, p_theta, output_weights, par_cur,
tilde_lambda,prior_par,theta_range,S, X, have_trend,alpha,
sd_proposal,discrepancy_type, simul_type,emulator,math_model)
``` |

`input` |
a matrix of observed inputs/design points of the experimental data. |

`output` |
a vector of experimental data. |

`R0_list` |
a List of matrices where the j-th matrix is an absolute difference matrix of the j-th input vector. |

`kernel_type` |
type of kernel. |

`p_theta` |
number of calibration parameters. |

`output_weights` |
a vector of the weights of the output. |

`par_cur` |
current value of the posterior samples. |

`tilde_lambda` |
a scalar parameter controling how close the math model to the reality in squared distance. |

`prior_par` |
a vector of prior parameters in the prior. |

`theta_range` |
a matrix for the range of the calibration parameters. The first column is the lower bound and the second column is the upper bound of the calibration parameters. |

`S` |
number of MCMC to run. |

`X` |
a matrix for the basis of the mean discrepancy. |

`have_trend` |
a bool value. It means the mean discrepancy is zero or not. |

`alpha` |
a vector of roughness parameters in the kernel functions. It is only useful if the power exponential correlation function is used. |

`sd_proposal` |
a vector for the standard deviation of the proposal distribution. |

`discrepancy_type` |
A string for type of discrepancy funcation. It can be chosen from 'no-discrepancy', 'GaSP' or 'S-GaSP'. |

`simul_type` |
tpye of math model. If the simul_type is 0, it means we use the RobustGaSP R package to emulate the math model. If the simul_type is 1, it means the function of the math model is given by the user. When simul_type is 2 or 3, the mathematical model is the geophyiscal model for Kilauea Volcano. If the simul_type is 2, it means it is for the ascending mode InSAR data; if the simul_type is 3, it means it is for the descending mode InSAR data. |

`emulator` |
an S4 class of rgasp model from the RobustGaSP R Package. |

`math_model` |
a function for the math model to be calibrated. |

A list. The first element is a matrix of the posterior samples after burn-in. The second element is a vector of posterior values after burn-in. The third element is the number of times of the proposed samples are accepted. The first value of the vector is the number of times that the proposed calibration parameters are accepted and the second value is the number of times of the proposed log inverse range parameter and the log nugget parameters are accepted, if there is a specification of the discrepancy function. The fourth element is the number of times the proposed samples of the calibration parameters are outside the range of the calibration parameters.

Mengyang Gu [aut, cre]

Maintainer: Mengyang Gu <mgu6@jhu.edu>

A. O'Hagan and M. C. Kennedy (2001), *Bayesian calibration of computer models*, *Journal of the Royal Statistical Society: Series B (Statistical Methodology*, **63**, 425-464.

Mengyang Gu. (2016). Robust Uncertainty Quantification and Scalable Computation for Computer Models with Massive Output. Ph.D. thesis. Duke University.

M. Gu and L. Wang (2017) *Scaled Gaussian Stochastic Process for Computer Model Calibration and Prediction*. arXiv preprint arXiv:1707.08215.

M. Gu (2018) *Jointly Robust Prior for Gaussian Stochastic Process in Emulation, Calibration and Variable Selection
*. arXiv preprint arXiv:1804.09329.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.