Description Usage Arguments Details Value Note Author(s) Examples
View source: R/plotCAR1plus1Q.R
Plot 3-dimensional data modeled with a 2-dimensional CAR1 plus a 1-dimensional structure matrix
1 2 3 4 |
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 two-dimensional plots.
The |
cardims |
Two-vector 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 two-dimensional plot
be reversed? Setting |
blocks |
Subset which two-dimensional plots are displayed. Default
is that the corresponding two-dimensional 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. |
For each value in blocks
, this function plots two
two-dimensional plots side-by-side. 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.
For each value in blocks
, this function plots two
two-dimensional plots side-by-side. 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.
Uses image.plot
from the fields
package.
Kate Cowles
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 )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.