data(iowaSW97_06small)
na<- 17
nb <- 12
nc <- 10
Q <- list( list(type="RW1",content=na), list(type="RW1",content=nb),
list(type="RW1",content=10))
alpha <- beta <- rep(0.01,4)
X<- matrix( rep(1, na * nb * nc), ncol=1)
# Add noise to data to see whether fitting method can extract true image
y <- iowaSW97_06small/100 + rnorm(na*nb*nc,sd=6)
outputSW <- CARrampsOcl.fit(alpha, beta, Q, y, nsamp=50,
seed=2, fixed = FALSE, coefs = TRUE,
randeffs = TRUE, designMat = X, mult = 2000, filename = "params.txt")
require(coda)
summary( as.mcmc(1/sqrt(outputSW$params)))
plot3Q( objname=outputSW, numcols=64, col=rev(terrain.colors(64)),
plotdims=c(1,2), rev.inds=c(FALSE,TRUE), blocks=NULL, animate=TRUE,
intv=3, title=c("Raw data","Estimated underlying truth"), sub=1997:2006 )
Run the code above in your browser using DataLab