prism_batch {PRISM.forecast} | R Documentation |
PRISM stage 2 by batch
Description
PRISM penalized linear regression function for a range of time (only used internally for back testing)
Usage
prism_batch(
data,
GTdata,
var,
n.training = 156,
UseGoogle = T,
alpha = 1,
nPred.vec = 0:3,
start.date = NULL,
n.weeks = NULL,
discount = 0.015,
sepL1 = F
)
Arguments
data |
time series of interest as xts, last element can be NA. (e.g., unemployment initial claim data in the same period as |
GTdata |
contemporaneous exogenous data as xts. (e.g., Google Trend data) |
var |
generated regressors from stage 1. |
n.training |
length of regression training period (by default = 156) |
UseGoogle |
boolean variable indicating whether to use Google Trend data. |
alpha |
penalty between lasso and ridge. alpha=1 represents lasso, alpha=0 represents ridge, alpha=NA represents no penalty. |
nPred.vec |
the number of periods ahead for forecast. nPred.vec could be a vector of intergers. e.g. nPred.vec=0:3 gives results from nowcast to 3-week ahead forecast. |
start.date |
the starting date for forecast. If NULL, the forecast start at the earliest possible date. |
n.weeks |
the number of weeks in the batch. If NULL, the forecast end at the latest possible date. |
discount |
exponential weighting: (1-discount)^lag (by default = 0.015) |
sepL1 |
if TRUE, use separate L1 regularization parameters for time series components and exogenous variables (Goolgle Trend data) |
Value
A list of following named objects
-
coef
coefficients for Intercept, z.lags, seasonal.lags and exogenous variables. -
pred
prediction results forn.weeks
fromstart.date
.