crit.odpc | R Documentation |
Computes One-Sided Dynamic Principal Components, choosing the number of components and lags automatically, to minimize an information criterion.
crit.odpc( Z, k_list = 1:5, max_num_comp = 5, ncores = 1, method, tol = 1e-04, niter_max = 500 )
Z |
Data matrix. Each column is a different time series. |
k_list |
List of values of k to choose from. |
max_num_comp |
Maximum possible number of components to compute. |
ncores |
Number of cores to use in parallel computations. |
method |
A string specifying the algorithm used. Options are 'ALS', 'mix' or 'gradient'. See details in |
tol |
Relative precision. Default is 1e-4. |
niter_max |
Integer. Maximum number of iterations. Default is 500. |
We apply the same stepwise approach taken in cv.odpc
, but now to minimize an
information criterion instead of the cross-validated forecasting error. The criterion is
inspired by the IC_{p3} criterion proposed in Bai and Ng (2002).
Let \widehat{σ}^{2}_{1,k} be the reconstruction mean squared error for
the first ODPC defined using k lags. Let T^{\ast,1,k}=T-2k.
Then we choose the
value k^{\ast,1} in k_list
that minimizes
{BNG}_{1,k}=\log≤ft( \widehat{σ}^{2}_{1,k} \right) + ( k+1 ) \frac{\log≤ft(\min(T^{\ast,1,k},m)\right)}{\min(T^{\ast,1,k},m)}.
Suppose now that max_num_comp
≥q 2 and we
have computed q-1 dynamic principal components, q-1 < max_num_comp
, each with k_{1}^{i}=k_{2}^{i}=k^{\ast, i} lags, i=1,…,q-1.
Let \widehat{σ}^{2}_{q,k} be the reconstruction mean squared error for
the fit obtained using q components, where the first q-1 components are defined using
k^{\ast, i}, i=1,…,q-1 and the last component is defined using k lags.
Let T^{\ast,q,k}=T-\max\lbrace 2k^{\ast,1},…,2k^{\ast,q-1},2k \rbrace.
Let k^{\ast,q} be the value in k_list
that minimizes
{BNG}_{q,k}=\log≤ft( \widehat{σ}^{2}_{q,k} \right) + ≤ft(∑_{i=1}^{q-1}(k^{\ast,i}+1) + k+1 \right) \frac{\log≤ft(\min(T^{\ast,q,k},m)\right)}{\min(T^{\ast,q,k},m)} .
If {BNG}_{q,k^{\ast,q}} is larger than {BNG}_{q-1,k^{\ast,q-1}} we stop and the final model is the ODPC with q-1 components. Else we add the q-th component defined using k^{\ast,q} and continue as before.
An object of class odpcs, that is, a list of length equal to the number of computed components, each computed using the optimal value of k.
The i-th entry of this list is an object of class odpc
, that is, a list with entries
f |
Coordinates of the i-th dynamic principal component corresponding to the periods k_1 + 1,…,T. |
mse |
Mean squared error of the reconstruction using the first i components. |
k1 |
Number of lags used to define the i-th dynamic principal component f. |
k2 |
Number of lags of f used to reconstruct. |
alpha |
Vector of intercepts corresponding to f. |
a |
Vector that defines the i-th dynamic principal component |
B |
Matrix of loadings corresponding to f. Row number k is the vector of k-1 lag loadings. |
call |
The matched call. |
conv |
Logical. Did the iterations converge? |
components
, fitted
, plot
and print
methods are available for this class.
Peña D., Smucler E. and Yohai V.J. (2017). “Forecasting Multiple Time Series with One-Sided Dynamic Principal Components.” Available at https://arxiv.org/abs/1708.04705.
Bai J. and Ng S. (2002). “Determining the Number of Factors in Approximate Factor Models.” Econometrica, 70(1), 191–221.
odpc
, cv.odpc
, forecast.odpcs
T <- 50 #length of series m <- 10 #number of series set.seed(1234) f <- rnorm(T + 1) x <- matrix(0, T, m) u <- matrix(rnorm(T * m), T, m) for (i in 1:m) { x[, i] <- 10 * sin(2 * pi * (i/m)) * f[1:T] + 10 * cos(2 * pi * (i/m)) * f[2:(T + 1)] + u[, i] } # Choose parameters to perform a one step ahead forecast. Use 1 or 2 lags, only one component fit <- crit.odpc(x, k_list = 1:2, max_num_comp = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.