multivator (version 1.1-9)

betahat: Various intermediate expressions needed by the multivariate emulator

Description

Various intermediate expressions needed by the multivariate emulator

Usage

regressor(x,LoF)
beta_hat(expt,hp,LoF, ...)
betahat_mult(H, Sigmainv, d)
betahat_mult_Sigma(H, Sigma, d)
cstar(x1, x2=x1 , expt, hp,  LoF = NULL, Sigmainv=NULL, ...)
eq2.36(H, Sigmainv, d, log=TRUE)
eq2.36_Sigma(H, Sigma, d)
var.matrix(x1,x2=x1,hp, ...)

Arguments

x,x1,x2

Objects of class mdm: multivariate design matrix

H

Matrix of regressors (create this with regressor())

d

Vector of observations, possibly not all of the same dimensions (eg some elements might be Kelvin, others millimeters of rain per year)

expt

Object of class experiment

Sigma

The variance matrix of d

log

Boolean, with TRUE meaning to return the logarithm of the answer

Sigmainv

The inverse of the variance matrix of d, with default NULL meaning to calculate it directly using var.matrix()

LoF

A list of functions with default NULL meaning to use default_LoF()

hp

Object of class mhp: multivariate hyperparameters

...

Extra arguments which are passed (via var.matrix()) to corr.matrix() of the emulator package

Details

Function regressor() creates a (sort of) direct sum of regressor matrices for an overall regressor matrix. It returns a matrix whose rows are the regressor functions for each row in the df argument. Each type of observation has its own ‘slot’ of columns, the others being filled with zeros.

The emulator package should have used this method (rather than messing about with regressor.basis() and regressor.multi()).

To get the regression coefficients, the user should use function beta_hat(), which is the user-friendly version. It is a wrapper for function betahat_mult_Sigma().

The equation for var.matrix() is

$$ c^*\left(x,x'\right)= c\left(x,x'\right) - t(x)^TA^{-1}t(x') + \left\{h(x)^T - t(x)^TA^{-1}H\right\} \left(H^TA^{-1}H\right)^{-1}\left\{h(x')^T - t(x')^TA^{-1}H\right\}^T $$

See Also

multem

Examples

Run this code
# NOT RUN {
data(mtoys)

H <- regressor(toy_mm, toy_LoF)
Sigma <- var.matrix(toy_mm, hp=toy_mhp)
Sigmainv <- solve(Sigma)


jj <- toy_mm_maker(34,35,36)
expt  <- experiment(jj,obs_maker(jj,toy_mhp,toy_LoF,toy_beta))

x1 <- jj[c(20,40,100),]
xold(x1) <- 0.2

x2 <- jj[c(11,21:24,40:42),]
xold(x2) <- xold(x2)+0.1

#primary function of package:
multem(x=x1, expt, hp=toy_mhp, LoF=toy_LoF)

# conditional covariance matrix:
cstar(x1,x2, expt, hp=toy_mhp, LoF=toy_LoF)
 
# }

Run the code above in your browser using DataCamp Workspace