Learn R Programming

BACCO (version 1.0-50)

p.eqn8.supp: A postiori probability of hyperparameters

Description

Function to determine the a-postiori probability of hyperparameters $\rho$, $\lambda$ and $\psi_2$, given observations and $\psi_1$.

Usage

p.eqn8.supp(theta, D1, D2, H1, H2, d, include.prior=FALSE,
lognormally.distributed=FALSE, return.log=FALSE, phi)
p.eqn8.supp.vector(theta, D1, D2, H1, H2, d, include.prior=FALSE,
lognormally.distributed=FALSE, return.log=FALSE, phi)

Arguments

theta
Parameters
D1
Matrix of code run points
D2
Matrix of observation points
H1
Regression function for D1
H2
Regression function for D2
d
Vector of code output values and observations
include.prior
Boolean, with TRUE meaning to include the prior PDF for $\theta$ and default FALSE meaning return the likelihood, multiplied by an undetermined constant.
lognormally.distributed
Boolean, with TRUE meaning to assume prior is lognormal (see prob.theta() for more info)
return.log
Boolean, with default FALSE meaning to return the probability; TRUE means to return the (natural) logarithm of the answer.
phi
Hyperparameters

Details

The user should always use p.eqn8.supp(), which is a wrapper for p.eqn8.supp.vector(). The forms differ in their treatment of $\theta$. In the former, $\theta$ must be a vector; in the latter, $\theta$ may be a matrix, in which case p.eqn8.supp.vector() is applied to the rows.

References

M. C. Kennedy and A. O'Hagan 2001. Bayesian calibration of computer models. Journal of the Royal Statistical Society B, 63(3) pp425-464 M. C. Kennedy and A. O'Hagan 2001. Supplementary details on Bayesian calibration of computer models, Internal report, University of Sheffield. Available at http://www.shef.ac.uk/~st1ao/ps/calsup.ps R. K. S. Hankin 2005. Introducing BACCO, an R bundle for Bayesian analysis of computer code output, Journal of Statistical Software, 14(16)

See Also

W2,stage1

Examples

Run this code
data(toys)
p.eqn8.supp(theta=theta.toy, D1=D1.toy, D2=D2.toy, H1=H1.toy, H2=H2.toy,
d=d.toy, phi=phi.toy)

## Now try using the true hyperparameters, and data directly drawn from
## the appropriate multivariate distn:

phi.true <- phi.true.toy(phi=phi.toy)
jj <- create.new.toy.datasets(D1.toy , D2.toy)
d.toy <- jj$d.toy
p.eqn8.supp(theta=theta.toy, D1=D1.toy, D2=D2.toy, H1=H1.toy, H2=H2.toy, d=d.toy, phi=phi.true)


## Now try p.eqn8.supp() with a vector of possible thetas:
p.eqn8.supp(theta=sample.theta(n=11,phi=phi.true), D1=D1.toy, D2=D2.toy, H1=H1.toy, H2=H2.toy,  d=d.toy, phi=phi.true)

Run the code above in your browser using DataLab