ivbma.cv.study: Conducts a leave-one-out cross validation study using IVBMA

Description Usage Arguments Value References See Also Examples

View source: R/ivbma.cv.study.R

Description

This function allows one to conduct a leave-one-out cross validation study using IVBMA. It takes an appropriately constructed object and proceeds to drop each observation, fit IVBMA using the remaining observations, forms a posterior predictive distribution of the dropped observation and scores the predictive distribution along a number of metrics.

Usage

1

Arguments

d

Object containing data, d$Y, d$X, d$W, d$Z must all be defined

...

additional parameters to be passed to ivbma. In particular, you'll usually want to set s.

Value

This returns an n by 4 matrix. Row i of the matrix gives the squared error (SE), absolute error (AE), predictive variance (VAR) and continous ranked probability score (CRPS) of the posterior predictive distribution leaving observation i out and subsequently using i as the verifying observation.

References

Anna Karl and Alex Lenkoski (2012). "Instrumental Variable Bayesian Model Averaging via Conditional Bayes Factors" http://arxiv.org/abs/1202.5846

See Also

ivbma

Examples

1
2
3
4
5
6
set.seed(1)
data(growth)
s <- 2e1 ##To replicate KL, set this to 2e5
a.bma <- ivbma.cv.study(growth, s = s, print.every = s)
a.full <- ivbma.cv.study(growth, s = s, print.every = s, full = TRUE)
print(rbind(colMeans(a.bma), colMeans(a.full)))

ivbma documentation built on May 29, 2017, 12:31 p.m.

Related to ivbma.cv.study in ivbma...