Description Usage Arguments Value
PRISM penalized linear regression function for a range of time (only used internally for back testing)
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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
)
|
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) |
A list of following named objects
coef coefficients for Intercept, z.lags, seasonal.lags and exogenous variables.
pred prediction results for n.weeks from start.date.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.