Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/STmodel_predict.R
Compute the conditional expectations (i.e. predictions) at the unobserved
spacetime locations. Predictions are computed for the spacetime locations in
object
and/or STdata
, conditional on the observations (and
temporal trends) in object
and parameters given in x
.
1 2 3 4 5 6 
object 

x 
Model parameters for which to compute the conditional
expectation. Either as a vector/matrix or an 
STdata 

Nmax 
Limits the size of matrices constructed when computing expectations. Use a smaller value if memory becomes a problem. 
only.pars 
Compute only the regression parameters (using GLS) along with the related variance. 
nugget.unobs 
Value of nugget at unonserved locations, either a scalar
or a vector with one element per unobserved site. NOTE: All sites in

only.obs 
Compute predictions at only locations specified by
observations in 
pred.var, pred.covar 
Compute pointwise prediction variances; or
compute covariance matrices for the predicted time series at each location.

beta.covar 
Compute the full covariance matrix for the latent betafields, otherwise only the diagonal elements of V(betaobs) are computed. 
combine.data 
Combine 
type 
A single character indicating the type of prediction to
compute. Valid options are "f", "p", and "r", for full,
profile or restricted maximum likelihood (REML). For profile
and full the predictions are computed assuming that both covariance
parameters and regression parameters are known,
e.g. 
LTA 
Compute longterm temporal averages. Either a logical value or a
list; if 
transform 
Regard field as logGaussian and apply exponential transformation to predictions. For the final expectations two options exist, either a unbiased prediction or the (biased) meansquared error predictions. 
... 
Ignored additional arguments. 
In addition to computing the conditional expectation at a number of spacetime locations the function also computes predictions based on only the regression part of the model as well as the latent betafields.
Prediction are computed as the conditional expectation of a latent field
given observations. This implies that E(X_i Y_i) != Y_i
, with the
difference being due to smoothing over the nugget. Further two possible
variance can be computed (see below), V(X_iY_i)
and
V(X_iY_i)+nugget_i
. Here the nugget for unobserved locations needs
to be specified as an additional argument nugget.nobs
. The two
variances correspond, losely, to confidence and prediction intervals.
Variances are computed if pred.var=TRUE
pointwise variances for the
predictions (and the latent betafields) are
computed. If instead pred.covar=TRUE
the full covariance matrices for
each predicted time series is computed; this implies that the covariances between
temporal predictions at the same location are calculated but not, due
to memory restrictions, any covariances between locations.
beta.covar=TRUE
gives the full covariance matrices for the latent
betafields.
If transform!="none"
the field is assumed to be logGaussian and
expectations are transformed, and if pred.var=TRUE
the mean squared
prediction errors are given.
The function returns a list containing (objects not computed will be missing):
opts 
Copy of options used in the function call. 
pars 
A list with regression parameters and related variances.

beta 
A list with estimates of the betafields, including the
regression mean 
EX.mu 
predictions based on the regression parameters, geographic covariates, and temporal trends. I.e. only the deterministic part of the spatiotemporal model. 
EX.mu.beta 
Predictions based on the latentbeta fields, but excluding the residual nu field. 
EX 
Full predictions at the spacetime locations in

EX.pred 
Only for 
VX,VX.pred 
Pointwise variances and prediction variances (i.e. incl.
contribution from 
VX.full 
A list with (number of locations) elements, each element is a (number of timepoints)  by  (number of timepoints) temporal covariance matrix for the timeseries at each location. 
MSPE,MSPE.pred 
Pointwise meansquare prediction errors for the logGaussian fields. 
log.EX,log.VX.pred,log.VX 
Pointwise predictions and variances for
the untransformed fields when 
LTA 
A data.frame with temporal averages for locations specified by

I 
A vector with the locations of the observations in 
Johan Lindstrom
Other STmodel methods: MCMC.STmodel
,
c.STmodel
, createSTmodel
,
estimate.STmodel
,
estimateCV.STmodel
,
plot.STdata
, print.STmodel
,
print.summary.STmodel
,
qqnorm.predCVSTmodel
,
scatterPlot.predCVSTmodel
,
simulate.STmodel
,
summary.STmodel
Other predictSTmodel methods: plot.predCVSTmodel
,
print.predictSTmodel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  ##load data
data(mesa.model)
data(est.mesa.model)
##find regression parameters using GLS
x.reg < predict(mesa.model, est.mesa.model, only.pars = TRUE)
str(x.reg$pars)
## Not run:
##compute predictions at all locations, including betafields
pred.mesa.model < predict(mesa.model, est.mesa.model,
pred.var=TRUE)
## End(Not run)
##Let's load precomputed results instead.
data(pred.mesa.model)
##study results
print(pred.mesa.model)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.