## Not run:
# library(growfunctions)
# data(cps)
# y_short <- cps$y[,(cps$yr_label %in% c(2008: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 = 40,
# n.burn = 20,
# n.thin = 1)
#
# res_gp <- gpdpgrow(y = y_short
# n.iter = 10,
# n.burn = 4,
# n.thin = 1,
# n.tune = 0)
#
# ## Prediction Model Runs
# T_test <- 4
#
# pred_gmrf <- predict_functions( object = res_gmrf,
# J = 1000,
# T_test = T_test )
#
# T_yshort <- ncol(y_short)
# pred_gp <- predict_functions( object = res_gp,
# test_times = (T_yshort+1):(T_yshort+T_test) )
#
# ## plot estimated and predicted functions
# plot_gmrf <- predict_plot(object = pred_gmrf,
# units_label = cps$st,
# single_unit = TRUE,
# credible = FALSE)
#
# plot_gp <- predict_plot(object = pred_gp,
# units_label = cps$st,
# single_unit = FALSE,
# credible = TRUE)
# ## End(Not run)
Run the code above in your browser using DataLab