reality              package:calibrator              R Documentation

_R_e_a_l_i_t_y

_D_e_s_c_r_i_p_t_i_o_n:

     Function to compute reality, gratis _deus ex machina_.  Includes a
     simple computer model that substitutes for a complex climate
     model, and a simple function that substitutes for the base system,
     in this case the climate.

_U_s_a_g_e:

     model.inadequacy(X, set.seed.to.zero=TRUE, draw.from.prior=FALSE, export.true.hyperparameters=FALSE,phi=NULL)
     computer.model(X, params=NULL, set.seed.to.zero=TRUE,
     draw.from.prior=FALSE, export.true.hyperparameters=FALSE,phi=NULL)
     phi.true.toy(phi)

_A_r_g_u_m_e_n_t_s:

       X: Observation point

  params: Parameters needed by 'computer.model()'

set.seed.to.zero: Boolean, with the default value of 'TRUE' meaning to
          set the RNG seed to zero

draw.from.prior: Boolean, with default 'FALSE' meaning to generate
          obsevations from the "true" values of the parameters, and
          'TRUE' meaning to draw from the relevant apriori
          distribution.

export.true.hyperparameters: Boolean, with default value of 'FALSE'
          meaning to return the observed scalar.  Set to 'TRUE' to
          exercise omniscience and access the _true_ values of the
          parameters and hyperparameters.  Only the omnipotent should
          set this variable, and only the omniscient may see its true
          value.

     phi: In function 'phi.true.toy()' the hyperparameters phi.  Note
          that apriori distributions are unchanged (they are irrelevant
          to omniscient beings).

          In functions 'reality()' and 'computer.model()', the prior
          distributions of the hyperparameters is passed via 'phi' (so
          it only elements 'psi1.apriori' and 'psi2.apriori' need to be
          set). 

_D_e_t_a_i_l_s:

     Function 'reality()' provides _the_ scalar value observed at a
     point 'x'.  Evaluation expense is zero; there is no overhead.

     (However, it does not compute "reality": the function returns a
     value subject to observational error N(0,lambda) as per equation
     5.  It might be better to call this function 'observation()')

     Function 'computer.model()' returns the output of a simple,
     nonlinear computer model.

     Both functions documented here return a random variable drawn from
     an appropriate (correlated) multivariate Gaussian distribution,
     and are thus Gaussian processes.

     The approach is more explicit in the help pages of the emulator
     package.  There, Gaussian processes are generated by directly
     invoking 'rmvnorm()' with a suitable correlation matrix.

_A_u_t_h_o_r(_s):

     Robin K. S. Hankin

_R_e_f_e_r_e_n_c_e_s:

     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 <URL:
     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)

_S_e_e _A_l_s_o:

     'computer.model'

_E_x_a_m_p_l_e_s:

       data(toys)

       computer.model(X=D2.toy,params=theta.toy)
       computer.model(D1.toy)
       computer.model(X=x.toy, params=extractor.toy(D1.toy)$t.vec)

       phi.fix <- phi.change(old.phi=phi.toy,
                psi1=c(1, 0.5, 1, 1, 0.5,  0.4),phi.fun=phi.fun.toy)
           #The values come from c(REAL.SCALES,REAL.SIGMA1SQUARED) as
           #seen in the sourcecode for computer.model().

       computer.model(D1.toy)   # use debug(computer.model) and examine
                                # var.matrix directly.  It should match the
                                #  output from V1():

               # first fix phi so that it has the correct values for psi1 (see the
               # section on psi1 in ?phi.fun.toy for how to get this):

        phi.fix <- phi.change(old.phi=phi.toy,psi1=c(1, 0.5, 1.0, 1.0, 0.5,
        0.4), phi.fun=phi.fun.toy)
        V1(D1.toy,phi=phi.fix)



     # What are the hyperparameters that were used to create reality?
     phi.true.toy(phi=phi.toy)

     # 
      computer.model(X=D2.toy,params=theta.toy,draw.from.prior=TRUE,phi=phi.toy)

