Title: | Sufficient Forecasting using Factor Models |
---|---|
Description: | The sufficient forecasting (SF) method is implemented by this package for a single time series forecasting using many predictors and a possibly nonlinear forecasting function. Assuming that the predictors are driven by some latent factors, the SF first conducts factor analysis and then performs sufficient dimension reduction on the estimated factors to derive predictive indices for forecasting. The package implements several dimension reduction approaches, including principal components (PC), sliced inverse regression (SIR), and directional regression (DR). Methods for dimension reduction are as described in: Fan, J., Xue, L. and Yao, J. (2017) <doi:10.1016/j.jeconom.2017.08.009>, Luo, W., Xue, L., Yao, J. and Yu, X. (2022) <doi:10.1093/biomet/asab037> and Yu, X., Yao, J. and Xue, L. (2022) <doi:10.1080/07350015.2020.1813589>. |
Authors: | Jianqing Fan [aut], Jing Fu [aut, cre], Wei Luo [aut], Lingzhou Xue [aut], Jiawei Yao [aut], Xiufan Yu [aut] |
Maintainer: | Jing Fu <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.0 |
Built: | 2025-02-03 04:24:03 UTC |
Source: | https://github.com/jingfu1224/sufficientforecasting |
This is a simulated dataset consisting of predictors, responses, and additional predictors to make forecasting at a future time. In this example, the dimension of predictors is p=100, and the number of observed time periods is T=100.
dataExample
dataExample
dataExample$X
simulated predictors; a p by T matrix
dataExample$y
simulated responses; a T by 1 vector
dataExample$newX
simulated new predictors for forecasting; a p by 1 vector
Estimate the number of common factors K
getK(y, X, Kmax = 12)
getK(y, X, Kmax = 12)
y |
Response, T by 1 vector |
X |
Predictors, p by T matrix |
Kmax |
A prescribed upper bound that possibly increases with p and T (default = 12) |
Estimate of K
Bai, J., and Ng, S. (2002), Determining the number of factors in approximate factor models, Econometrica 70(1), 191-221.
Li, H., Li, Q. and Shi, Y. (2017), Determining the number of factors when the number of factors can increase with sample size, Journal of Econometrics 197(1), 76–86.
Select a method from PC, SIR and DR to do point prediction
SF( y, X, newX = NULL, K = "default", L = 1, method = "SIR.LM", hyperparameter = list() )
SF( y, X, newX = NULL, K = "default", L = 1, method = "SIR.LM", hyperparameter = list() )
y |
Response, T by 1 matrix |
X |
Predictors, p by T matrix |
newX |
New predictors, a vector contains p entries (or |
K |
The number of common factors (default = obtained by
|
L |
The number of predictive indices, L is required to be no greater than K (default = 1) |
method |
Select one from |
hyperparameter |
A list of parameters for the corresponding method |
Out-of-sample forecast for newX
; or in-sample forecast for the last
observed data point if newX
is NULL
Fan, J., Xue, L. and Yao, J. (2017), Sufficient forecasting using factor models, Journal of econometrics 201(2), 292–306
Luo, W., Xue, L., Yao, J. and Yu, X. (2022), Inverse moment methods for sufficient forecasting using high-dimensional predictors, Biometrika 109(2), 473–487.
Yu, X., Yao, J. and Xue, L. (2022), Nonparametric estimation and conformal inference of the sufficient forecasting with a diverging number of factors, Journal of Business & Economic Statistics 40(1), 342–354.
utils::data(dataExample,package = "sufficientForecasting") SF(dataExample$y,dataExample$X,method = "SIR.LLM", hyperparameter = list(nslices = 5,discretization = TRUE)) SF(dataExample$y,dataExample$X,dataExample$newX,method = "DR") SF(dataExample$y,dataExample$X,dataExample$newX,method = "PC")
utils::data(dataExample,package = "sufficientForecasting") SF(dataExample$y,dataExample$X,method = "SIR.LLM", hyperparameter = list(nslices = 5,discretization = TRUE)) SF(dataExample$y,dataExample$X,dataExample$newX,method = "DR") SF(dataExample$y,dataExample$X,dataExample$newX,method = "PC")
Conformal inference of the sufficient forecasting
SF.CI( y, X, newX = NULL, type = "LM", K = "default", L = 1, alpha = 0.1, discretization = TRUE, nslices = 10 )
SF.CI( y, X, newX = NULL, type = "LM", K = "default", L = 1, alpha = 0.1, discretization = TRUE, nslices = 10 )
y |
Response, T by 1 matrix |
X |
Predictors, p by T matrix |
newX |
New predictors, a vector contains p entries (or |
type |
|
K |
The number of common factors (default = obtained
by |
L |
The number of predictive indices, L is required to be no greater than K (default = 1) |
alpha |
Mis-coverage rate |
discretization |
Hyperparameter in SIR (default = |
nslices |
Hyperparameter in SIR (default = 10) |
A list with components
Out-of-sample forecast for newX
; or in-sample forecast
for the last observed data point if newX
is NULL
Lower bound of conformal interval
Upper bound of conformal interval
Yu, X., Yao, J. and Xue, L. (2022), Nonparametric estimation and conformal inference of the sufficient forecasting with a diverging number of factors, Journal of Business & Economic Statistics 40(1), 342–354.
utils::data(dataExample,package = "sufficientForecasting") SF.CI(dataExample$y,dataExample$X,type = "LM",alpha = 0.05)
utils::data(dataExample,package = "sufficientForecasting") SF.CI(dataExample$y,dataExample$X,type = "LM",alpha = 0.05)
Directional regression for sufficient forecasting
SF.DR(y, X, newX = NULL, K = "default", L = 1, etaopg = "default", nslices = 3)
SF.DR(y, X, newX = NULL, K = "default", L = 1, etaopg = "default", nslices = 3)
y |
Response, T by 1 matrix |
X |
Predictors, p by T matrix |
newX |
New predictors, a vector contains p entries (or |
K |
The number of common factors (default = obtained
by |
L |
The number of predictive indices, L is required to be no greater than K (default = 1) |
etaopg |
hyperparameter in DR (default = obtained by |
nslices |
hyperparameter in DR (default = 3) |
Out-of-sample forecast for newX
; or in-sample forecast for the last
observed data point if newX
is NULL
Luo, W., Xue, L., Yao, J. and Yu, X. (2022), Inverse moment methods for sufficient forecasting using high-dimensional predictors, Biometrika 109(2), 473–487.
utils::data(dataExample,package = "sufficientForecasting") SF.DR(dataExample$y,dataExample$X,dataExample$newX)
utils::data(dataExample,package = "sufficientForecasting") SF.DR(dataExample$y,dataExample$X,dataExample$newX)
Principal component regression for sufficient forecasting
SF.PC(y, X, newX = NULL, K = "default", L = "default")
SF.PC(y, X, newX = NULL, K = "default", L = "default")
y |
Response, T by 1 matrix |
X |
Predictors, p by T matrix |
newX |
New predictors, a vector contains p entries (or |
K |
The number of common factors (default = obtained
by |
L |
The number of principal components used in the prediction,
L is required to be no greater than K (default = |
Out-of-sample forecast for newX
; or in-sample forecast for the last
observed data point if newX
is NULL
utils::data(dataExample,package = "sufficientForecasting") SF.PC(dataExample$y,dataExample$X)
utils::data(dataExample,package = "sufficientForecasting") SF.PC(dataExample$y,dataExample$X)
Sliced inverse regression for sufficient forecasting
SF.SIR( y, X, newX = NULL, type = "LM", K = "default", L = 1, discretization = TRUE, nslices = 10 )
SF.SIR( y, X, newX = NULL, type = "LM", K = "default", L = 1, discretization = TRUE, nslices = 10 )
y |
Response, T by 1 matrix |
X |
Predictors, p by T matrix |
newX |
New predictors, a vector contains p entries (or |
type |
|
K |
The number of common factors (default = obtained
by |
L |
The number of predictive indices, L is required to be no greater than K (default = 1) |
discretization |
Hyperparameter in SIR (default = |
nslices |
Hyperparameter in SIR (default = 10) |
Out-of-sample forecast for newX
; or in-sample forecast for the last
observed data point if newX
is NULL
Fan, J., Xue, L. and Yao, J. (2017), Sufficient forecasting using factor models, Journal of econometrics 201(2), 292–306.
Yu, X., Yao, J. and Xue, L. (2022), Nonparametric estimation and conformal inference of the sufficient forecasting with a diverging number of factors, Journal of Business & Economic Statistics 40(1), 342–354.
utils::data(dataExample,package = "sufficientForecasting") SF.SIR(dataExample$y,dataExample$X,type = "LLM")
utils::data(dataExample,package = "sufficientForecasting") SF.SIR(dataExample$y,dataExample$X,type = "LLM")