predict_functions.gmrfdpgrow {growfunctions} | R Documentation |
Use the model-estimated iGMRF precision parameters from gmrfdpgrow() to predict the iGMRF function at
future time points. Inputs the gmrfdpgrow
object of estimated parameters.
Description
A companion function to gmrfdpgrow
Usage
## S3 method for class 'gmrfdpgrow'
predict_functions(object, J = 500, T_test, ...)
Arguments
object |
Object of class |
J |
Scalar denoting number of draws to take from posterior predictive for each unit.
Defaults to |
T_test |
The number of equally-spaced time points to predict the iGMRF functions ahead of
of the functions estimated at |
... |
further arguments passed to or from other methods. |
Value
out A list object containing containing two matrices; the first is a P x (N*T) matrix of predicted function values for each of P sampled iterations. N is slow index and denotes the number of experimental units. The second matrix is an N x T average over the P sampled draws, composed in Rao-Blackwellized fashion.
Note
Intended as a companion function for gmrfdpgrow
for prediction
Author(s)
Terrance Savitsky tds151@gmail.com
See Also
Examples
## Not run:
library(growfunctions)
data(cps)
y_short <- cps$y[,(cps$yr_label %in% c(2010:2013))]
t_train <- ncol(y_short)
N <- nrow(y_short)
t_test <- 4
## Model Runs
res_gmrf = gmrfdpgrow(y = y_short,
q_order = c(2,4),
q_type = c("tr","sn"),
n.iter = 100,
n.burn = 50,
n.thin = 1)
## Prediction Model Runs
T_test <- 4
pred_gmrf <- predict_functions( object = res_gmrf,
J = 1000,
T_test = T_test )
## plot estimated and predicted functions
plot_gmrf <- predict_plot(object = pred_gmrf,
units_label = cps$st,
single_unit = TRUE,
credible = FALSE)
## End(Not run)