### R code from vignette source 'both_papers.Rnw' ################################################### ### code chunk number 1: both_papers.Rnw:409-409 ################################################### ################################################### ### code chunk number 2: both_papers.Rnw:410-413 ################################################### set.seed(0) require(BACCO) data(toy) ################################################### ### code chunk number 3: both_papers.Rnw:416-418 ################################################### toy <- latin.hypercube(20,6) head(toy) ################################################### ### code chunk number 4: both_papers.Rnw:427-429 ################################################### f <- function(x) sum( (0:6)*x) expectation <- apply(regressor.multi(toy), 1, f) ################################################### ### code chunk number 5: both_papers.Rnw:437-440 ################################################### toy.scales <- rep(1,6) toy.sigma <- 0.4 A <- toy.sigma*corr.matrix(xold=toy, scales=toy.scales) ################################################### ### code chunk number 6: both_papers.Rnw:448-449 ################################################### d <- as.vector(rmvnorm(n=1 , mean=expectation , sigma=A)) ################################################### ### code chunk number 7: both_papers.Rnw:457-460 ################################################### x.unknown <- rep(0.5 , 6) jj <- interpolant(x.unknown, d, toy, scales=toy.scales, g=TRUE) print(drop(jj$mstar.star)) ################################################### ### code chunk number 8: both_papers.Rnw:468-469 ################################################### print(jj$betahat) ################################################### ### code chunk number 9: both_papers.Rnw:473-474 ################################################### print(jj$beta.marginal.sd) ################################################### ### code chunk number 10: both_papers.Rnw:500-502 ################################################### scales.optim <- optimal.scales(val=toy, scales.start=rep(1,6), d=d, give=FALSE) print(scales.optim) ################################################### ### code chunk number 11: both_papers.Rnw:515-517 ################################################### interpolant(x.unknown, d, toy, scales=toy.scales , g=FALSE) interpolant(x.unknown, d, toy, scales=scales.optim, g=FALSE) ################################################### ### code chunk number 12: both_papers.Rnw:564-639 ################################################### data(results.table) data(expert.estimates) # Decide which column we are interested in: output.col <- 26 wanted.cols <- c(2:9,12:19) # Decide how many to keep; # 30-40 is about the most we can handle: wanted.row <- 1:27 # Values to use are the ones that appear in goin.test2.comments: val <- results.table[wanted.row , wanted.cols] # Now normalize val so that 0