s.chi: Variance estimator

Description Usage Arguments Details Author(s) References Examples

Description

Returns estimator for a priori sigma^2

Usage

1
s.chi(H, Ainv, d, s0 = 0, fast.but.opaque = TRUE)

Arguments

H

Regression basis function (eg that returned by regressor.multi())

Ainv

inv(A) where A is a correlation matrix (eg that returned by corr.matrix())

d

Vector of data points

s0

Optional offset

fast.but.opaque

Boolean, with default TRUE meaning to use quad.form(), and FALSE meaning to use straightforward %*%. The first form should be faster, but the code is less intelligible than the second form. Comparing the returned value with this argument on or off should indicate the likely accuracy attained.

Details

See O'Hagan's paper (ref below), equation 12 for details and context.

Author(s)

Robin K. S. Hankin

References

A. O'Hagan 1992. “Some Bayesian Numerical Analysis”, pp345-363 of Bayesian Statistics 4 (ed J. M. Bernardo et al), Oxford University Press

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# example has 10 observations on 6 dimensions.
# function is just sum( (1:6)*x) where x=c(x_1, ... , x_2)
data(toy)
val <- toy
colnames(val) <- letters[1:6]
H <- regressor.multi(val)
d <- apply(H,1,function(x){sum((0:6)*x)})


# create A matrix and its inverse:
A <- corr.matrix(val,scales=rep(1,ncol(val)))
Ainv <- solve(A)

# add some suitably correlated noise:
d <- as.vector(rmvnorm(n=1, mean=d, 0.1*A))

# now evaluate s.chi():
s.chi(H, Ainv, d)


# assess accuracy:
s.chi(H, Ainv, d, fast=TRUE) - s.chi(H, Ainv, d, fast=FALSE)

emulator documentation built on May 17, 2018, 9:03 a.m.