data(iowaSW97_06small)
na<- 17
nb <- 12
nc <- 10
Q <- list( list(type="CAR1",content=c(na,nb)), list(type="RW1",content=nc))
alpha <- beta <- rep(0.01,3)
X<- matrix( rep(1, na * nb * nc), ncol=1)
y <- iowaSW97_06small/100 + rnorm(na*nb*nc,sd=6) # add noise
print(system.time(outputSW2 <- CARrampsOcl.fit(alpha, beta, Q, y, nsamp=50,
seed=2, fixed = FALSE, coefs = TRUE,
randeffs = TRUE, designMat = X, mult = 2000, filename = "params.txt")))
plotCAR1plus1Q( objname=outputSW2, numcols=64, col=rev(terrain.colors(64)),
plotdim=1, cardims=c(na,nb),
rev.inds=c(FALSE,TRUE), blocks=NULL, animate=FALSE, intv=3,
title=c("Raw data","Estimated underlying truth"), sub=1997:2006 )
Run the code above in your browser using DataLab