predict_functions.gmrfdpgrow | R Documentation |
gmrfdpgrow
object of estimated parameters.A companion function to gmrfdpgrow
## S3 method for class 'gmrfdpgrow'
predict_functions(object, J = 500, T_test, ...)
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. |
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.
Intended as a companion function for gmrfdpgrow
for prediction
Terrance Savitsky tds151@gmail.com
gmrfdpgrow
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.