phi.fun.toy {calibrator}  R Documentation 
Functions to create or change hyperparameters
Description
Function to create (phi.fun.toy
) or modify
(phi.change
) toy hyperparameters \phi
in a form suitable for passing to the other functions in the library.
The user should never make \phi
by hand; always use one of
these functions
Usage
phi.fun.toy(rho, lambda, psi1, psi1.apriori, psi2, psi2.apriori,
theta.apriori)
phi.change(phi.fun, old.phi = NULL, rho = NULL, lambda = NULL,
psi1 = NULL, psi1.apriori=NULL, psi1.apriori.mean=NULL,
psi1.apriori.sigma=NULL, psi2 = NULL, psi2.apriori=NULL,
psi2.apriori.mean=NULL, psi2.apriori.sigma=NULL,
theta.apriori=NULL, theta.apriori.mean=NULL,
theta.apriori.sigma=NULL)
Arguments
phi.fun 
In 
old.phi 
In function 
rho 
Correlation hyperparameter appearing in main equation 
lambda 
Noise hyperparameter 
psi1 
Roughness lengths hyperparameter for design matrix
Recall that 
psi1.apriori 
A priori PDF for 
psi1.apriori.mean 
In function 
psi1.apriori.sigma 
In function 
psi2 
Roughness lengths hyperparameter for Internal function NB: function 
psi2.apriori 
A priori PDF for As for The second element of 
psi2.apriori.mean 
In 
psi2.apriori.sigma 
In

theta.apriori 
Apriori PDF for

theta.apriori.mean 
In 
theta.apriori.sigma 
In 
Details
Note that this toy function contains within itself
pdm.maker.toy()
which extracts omega_x
and
omega_t
and sigma1squared
from psi1
.
This will need to be changed for realworld applications.
Earlier versions of the package had pdm.maker.toy()
defined separately.
Value
Returns a list of several elements:
rho 
Correlation hyperparameter 
lambda 
Noise hyperparameter 
psi1 
Roughness lengths hyperparameter for 
psi1.apriori 
Apriori mean and variance matrix for 
psi2 
Roughness lengths hyperparameter for 
psi2.apriori 
Apriori mean and variance matrix for 
theta.apriori 
Apriori mean and variance matrix for the parameters 
omega_x 
Positive definite matrix for the lat/long part of

omega_t 
Positive definite matrix for the code parameters theta,
whose diagonal is 
omegastar_x 
Positive definite matrix for use in equation 13 of
the supplement; represents distances between rows of 
sigma1squared 
variance 
sigma2squared 
variance 
omega_x.upper 
Upper triangular Cholesky decomposition for 
omega_x.lower 
Lower triangular Cholesky decomposition for 
omega_t.upper 
Upper triangular Cholesky decomposition for 
omega_t.lower 
Lower triangular Cholesky decomposition for 
a 
Precalculated matrix for use in

b 
Precalculated matrix for use in

c 
Precalculated scalar for use in

A 
Precalculated scalarfor use in

A.upper 
Upper triangular Cholesky decomposition for 
A.lower 
Lower triangular Cholesky decomposition for 
Author(s)
Robin K. S. Hankin
References

M. C. Kennedy and A. O'Hagan 2001. Bayesian calibration of computer models. Journal of the Royal Statistical Society B, 63(3) pp425464

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.tonyohagan.co.uk/academic/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
Examples
phi.fun.toy(100,101,1:6,list(mean=rep(1,6),sigma=1+diag(6)),50:55,
list(mean=rep(0,4),sigma=0.1+diag(4)),
list(mean=0.1+(1:3),sigma=2.1+diag(3)))
phi.fun.toy(rho=1, lambda=1,
psi1 = structure(c(1.1, 1.2, 1.3, 1.4, 1.5, 0.7),
.Names = c("x", "y", "A","B", "C","s1sq")),
psi1.apriori = list(
mean=rep(0,6), sigma=0.4+diag(6)),
psi2=structure(c(2.1, 2.2), .Names = c("x","y")),
psi2.apriori = list(mean=rep(0,5),sigma=0.2+diag(5)),
theta.apriori = list(mean=0.1+(1:3),sigma=2.1+diag(3))
)
data(toys)
phi.change(phi.fun=phi.fun.toy, old.phi = phi.toy, rho = 100)
phi.change(phi.fun=phi.fun.toy, old.phi = phi.toy,
theta.apriori.sigma = 4*diag(3))
identical(phi.toy, phi.change(phi.fun=phi.fun.toy, old.phi=phi.toy))