predict.spBFA | R Documentation |
Predicts future observations from the spBFA
model.
## S3 method for class 'spBFA'
predict(
object,
NewTimes,
NewX = NULL,
NewTrials = NULL,
type = "temporal",
Verbose = TRUE,
seed = 54,
...
)
object |
A |
NewTimes |
A numeric vector including desired time(s) points for prediction. |
NewX |
A matrix including covariates at times |
NewTrials |
An array indicating the trials for categorical predictions. The array must have dimension |
type |
A character string indicating the type of prediction, choices include "temporal" and "spatial". Spatial prediction has not been implemented yet. |
Verbose |
A boolean logical indicating whether progress should be output. |
seed |
An integer value used to set the seed for the random number generator (default = 54). |
... |
other arguments. |
predict.spBFA
uses Bayesian krigging to predict vectors at future
time points. The function returns the krigged factors (Eta
) and also the observed outcomes (Y
).
predict.spBFA
returns a list containing the following objects.
Eta
A list
containing NNewVistis
matrices, one for each new time prediction. Each matrix is dimension NKeep x K
, where
K
is the number of latent factors Each matrix contains posterior samples obtained by Bayesian krigging.
Y
A list
containing NNewVistis
posterior predictive distribution
matrices. Each matrix is dimension NKeep x (M * O)
, where M
is the number of spatial locations and O
the number of observation types.
Each matrix is obtained through Bayesian krigging.
Samuel I. Berchuck
###Load pre-computed regression results
data(reg.bfa_sp)
###Compute predictions
pred <- predict(reg.bfa_sp, NewTimes = 3)
pred.observations <- pred$Y$Y10 # observed data predictions
pred.krig <- pred$Eta$Eta10 # krigged parameters
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.