Description Usage Arguments Value Author(s) References Examples
View source: R/MV2SRR_v210407.R
This prototype function runs the 2-step Ridge Regression technique in Goulet Coulombe (2020). Basically, the technique allowing parameters of a linear equation(s) to evolve as driftless random walks and computations are carried via a closed-form solution in the form of data-augmented ridge regression rather than with typically burdensome filtering procedures. It handles the univariate and multivariate cases, and performs cross-validation of lambda (the amount of time variation). It will especially fast when T is below 1000, which is customary for macroeconomic time series, on which TVP models are often applied.
1 2 3 |
X |
Predictors (T * K) |
Y |
Targets (T * M), where M can be 1 (univariate case) |
lambda.candidates |
Candidate values for lambda (amount of time variation) to evaluate by CV. |
oosX |
A vector of X for which to produce one out-of-sample forecast. Since parameters evolve according to random walks, one should need to reevaluate at each t. |
lambda2 |
Penalty on beta_0 (starting values of the random walks). Keep it soft unless X is large. |
kfold |
Number of folds for CV (5 or 10, usually). |
CV.plot |
If Switched to TRUE, the function will plot CV graph, which can be a useful check of whether your lambda.candidates are legit. |
CV.2SRR |
Should we cross-validate again after the weight updating step? Can help marginally at low cost for small models. Can help marginally but incurs a higher computational cost for large X or Y. |
sig.u.param |
How much should we shrink sigma_u estimates to the homogenous case? 1 is not at all, and 0 is completely. Intermediate values like 0.25, 0.5, and 0.75 are recommended. The formula is final.sig.u = [(hetero)^(sig.u.param)]*[(homo)^(1-sig.u.param)]. |
sig.u.param |
How much should we shrink sigma_eps estimates to the no-evolving volatility case? 1 is not at all, and 0 is completely. Intermediate values like 0.25, 0.5, and 0.75 are recommended. The formula is final.sig.eps = [(Garch(1,1))^(sig.u.param)]*[(homo)^(1-sig.u.param)]. |
ols.prior |
Will shrink beta_0 (at a strength given by lambda2) to OLS rather than 0. Not recommended unless X is very small. The Half & Half strategy described in the paper is typically preferable. |
betas.rr |
Betas from a plain ridge regression (no two steps). |
betas.2srr |
Betas from 2SRR (M * K * T). |
lambdas |
Choice of lambda by CV. Will be a vector if M>1. |
forecast |
A forecast for y if oosX was supplied. Will be a vector if M>1. |
sig.eps |
Normalized evolving volatility weights. |
yhat.rr |
In-sample span from a one-step approach. Will be a matrix if M>1. |
yhat.2srr |
In-sample span from 2srr. Will be a matrix if M>1. |
Philippe Goulet Coulombe
Original paper is https://arxiv.org/abs/2009.00401
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.