srlTS {srlTS} | R Documentation |
Perform time series ranked sparsity methods
Description
Perform time series ranked sparsity methods
Usage
srlTS(
y,
X = NULL,
n_lags_max,
gamma = c(0, 2^(-2:4)),
ptrain = 0.8,
pf_eps = 0.01,
w_endo,
w_exo,
ncvreg_args = list(penalty = "lasso", returnX = FALSE, lambda.min = 0.001)
)
## S3 method for class 'srlTS'
plot(x, log.l = TRUE, ...)
## S3 method for class 'srlTS'
coef(object, choose = c("AICc", "BIC", "all"), ...)
## S3 method for class 'srlTS'
print(x, ...)
## S3 method for class 'srlTS'
summary(object, ...)
Arguments
y |
univariate time series outcome |
X |
matrix of predictors (no intercept) |
n_lags_max |
maximum number of lags to consider |
gamma |
vector of exponent for weights |
ptrain |
prop. to leave out for test data |
pf_eps |
penalty factors below this will be set to zero |
w_endo |
optional pre-specified weights for endogenous terms |
w_exo |
optional pre-specified weights for exogenous terms (see details) |
ncvreg_args |
additional args to pass through to ncvreg |
x |
a srlTS object |
log.l |
Should the x-axis (lambda) be logged? |
... |
passed to downstream functions |
object |
a srlTS object |
choose |
which criterion to use for lambda selection (AICc, BIC, or all) |
Details
The default weights for exogenous features will be chosen based on
a similar approach to the adaptive lasso (using bivariate OLS estimates). For
lower dimensional X, it's advised to set w_exo="unpenalized"
, because
this allows for statistical inference on exogenous variable coefficients
via the summary
function.
Value
A list of class slrTS
with elements
fits |
a list of lasso fits |
ncvreg_args |
arguments passed to ncvreg |
gamma |
the (negative) exponent on the penalty weights, one for each fit |
n_lags_max |
the maximum number of lags |
y |
the time series |
X |
the utilized matrix of exogenous features |
oos_results |
results on test data using best of fits |
train_idx |
index of observations used in training data |
x invisibly
a vector of model coefficients
x (invisibly)
the summary object produced by ncvreg evaluated at the best tuning parameter combination (best AICc).
References
Breheny, P. and Huang, J. (2011) Coordinate descent algorithms for nonconvex penalized regression, with applications to biological feature selection. Ann. Appl. Statist., 5: 232-253.
Peterson, R.A., Cavanaugh, J.E. Ranked sparsity: a cogent regularization framework for selecting and estimating feature interactions and polynomials. AStA Adv Stat Anal (2022). https://doi.org/10.1007/s10182-021-00431-7
See Also
predict.srlTS
Examples
data("LakeHuron")
fit_LH <- srlTS(LakeHuron)
fit_LH
coef(fit_LH)
plot(fit_LH)