Plot 3dimensional data modeled with a 2dimensional CAR1 plus a 1dimensional structure matrix
Description
Plot 3dimensional data modeled with a 2dimensional CAR1 plus a 1dimensional structure matrix
Usage
1 2 3 4 
Arguments
objname 
name of output object produced by 
numcols 
number of shades from the color palette to be used 
col 
color palette to be used in plotting; the default plots high values in green and low values in pink. 
plotdim 
This function produces a sequence of twodimensional plots.
The 
cardims 
Twovector specifying the number of rows and columns in the
CAR1 structure matrix; same as dimension of CAR1 Q matrix provided to

rev.inds 
Should the plotting indices on each twodimensional plot
be reversed? Setting 
blocks 
Subset which twodimensional plots are displayed. Default
is that the corresponding twodimensional plot is displayed for each value of
the third dimension. To subset, set 
animate 
If 
intv 
How many seconds to wait before displaying next plot (ignored
if 
title 
Vector of character values; the titles of the two plots. 
sub 
Vector of subtitles for plots. 
Details
For each value in blocks
, this function plots two
twodimensional plots sidebyside. The left plot is of the raw data
input into the CARrampsOcl.fit function, and the right plot is of the
estimated means of the of the posterior distributions of the
corresponding random effects.
Value
For each value in blocks
, this function plots two
twodimensional plots sidebyside. The left plot is of the raw data
input into the CARrampsOcl.fit function, and the right plot is of the
estimated means of the of the posterior distributions of the
corresponding random effects.
Note
Uses image.plot
from the fields
package.
Author(s)
Kate Cowles
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  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 )
