Description Usage Arguments Note Author(s) References See Also Examples
Function 
E.theta.toy returns expectation of H_1(D) with respect to
theta; Edash.theta.toy returns expectation with
respect to Edash.  Function E.theta.toy also returns
information about nonlinear behaviour of h1(x,theta).
| 1 2 3 | 
| D2 | Observation points | 
| H1 | Regression function for D1 | 
| phi | hyperparameters.  Default value of  | 
| x | lat/long point (for  | 
| t.vec | Matrix whose rows are parameter values (for  | 
| k | Integer specifying column (for  | 
| give.mean | In  | 
| fast.but.opaque | In  | 
| a | Constant term, needed if  | 
| b | Linear term, needed if  | 
| x1 | In  | 
| x2 | In  | 
A terse discussion follows; see the calex.pdf vignette and the
1D case study in directory inst/doc/one/dim/ for more details
and examples.
Function E.theta.toy(give.mean=FALSE,...) does not
return the variance!  The matrix returned is a different size
from the variance matrix!
It returns the thing that must be added to
crossprod(E_theta(h1(x,theta)),t(E_theta(h1(x,theta)))) to give
E_theta(h1(x,theta).t(h1(x,theta))).
In other words, it returns
E_theta(h1(x,theta).t(h1(x,theta)))-
crossprod(E_theta(h1(x,theta)),t(E_theta(h1(x,theta)))).
If the terms of
h1() are of the form c(o,theta) (where o is a
vector that is a function of x alone, and independent of
theta), then the function will include the variance matrix, in
the lower right corner (zeroes elsewhere).
Function E.theta() must be updated if h1.toy()
changes: unlike E.theta() and Edash.theta(), it does not
“know” where the elements that vary with theta are, nor
their (possibly x-dependent) coefficients.
This form of the function requires x1 and x2 arguments,
for good form's sake, even though the returned value is independent of
x in the toy example.  To see why it is
necessary to include x, consider a simple case with
h1(x,theta)=(1,x*theta)'.  Now
E_theta(h(x,theta)) is just
(1,x*mean(theta))' but
E_theta(h_1(x,theta)h1(x,theta)^T)
is a 2-by-2 matrix (M, say) with E_theta(M)=h1(x,thetabar)h_1(x,thetabar)^T + variance terms.
ommitted: see dvi
All three functions here are intimately connected to the form of
h1.toy() and changing it (or indeed H1.toy()) will
usually require rewriting all three functions documented here.  Look
at the definition of E.theta.toy(give=F), and you will see that
even changing the meat of h1.toy() from c(1,x) to
c(x,1) would require a redefinition of E.theta.toy(g=F).
The only place that E.theta.toy(g=F) is used is internally in
hh.fun().  
Robin K. S. Hankin
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.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)
| 1 2 3 4 5 | data(toys)
E.theta.toy(D2=D2.toy,      H1=H1.toy,phi=phi.toy)
E.theta.toy(D2=D2.toy[1,],  H1=H1.toy,phi=phi.toy)
E.theta.toy(D2=x.toy,       H1=H1.toy,phi=phi.toy)
Edash.theta.toy(x=x.toy,t.vec=t.vec.toy,k=1, H1=H1.toy,phi=phi.toy)
 | 
Loading required package: emulator
Loading required package: mvtnorm
      h1.const   x   y   A B   C
obs.1        1 0.5 0.7 0.8 0 0.6
obs.2        1 0.9 0.3 0.8 0 0.6
obs.3        1 0.3 0.1 0.8 0 0.6
obs.4        1 0.1 0.9 0.8 0 0.6
obs.5        1 0.7 0.5 0.8 0 0.6
       h1.const   x   y   A B   C
code.1        1 0.5 0.7 0.8 0 0.6
       h1.const   x   y   A B   C
code.1        1 0.5 0.6 0.8 0 0.6
       h1.const   x   y          A         B          C
code.1        1 0.5 0.6 0.06559159 0.1862606 0.06428571
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.