Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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

Author(s)

Robin K. S. Hankin

See Also

Examples

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)

multivator

A Multivariate Emulator

v1.1-10
GPL-2
Authors
Robin K. S. Hankin [aut, cre] (<https://orcid.org/0000-0001-5982-0415>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.