Type: | Package |
Title: | Sufficient Forecasting using Factor Models |
Version: | 0.1.0 |
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>. |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.2.3 |
Imports: | gam, stats |
Depends: | R (≥ 2.10) |
Suggests: | knitr, rmarkdown |
VignetteBuilder: | knitr |
URL: | https://github.com/JingFu1224/sufficientForecasting |
BugReports: | https://github.com/JingFu1224/sufficientForecasting/issues |
NeedsCompilation: | no |
Packaged: | 2023-02-17 03:07:49 UTC; fusei |
Author: | Jianqing Fan [aut], Jing Fu [aut, cre], Wei Luo [aut], Lingzhou Xue [aut], Jiawei Yao [aut], Xiufan Yu [aut] |
Maintainer: | Jing Fu <jingfu991224@outlook.com> |
Repository: | CRAN |
Date/Publication: | 2023-02-17 10:00:06 UTC |
sufficientForecasting: 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.
Author(s)
Maintainer: Jing Fu jingfu991224@outlook.com
Authors:
Jianqing Fan
Wei Luo
Lingzhou Xue
Jiawei Yao
Xiufan Yu
See Also
Useful links:
Report bugs at https://github.com/JingFu1224/sufficientForecasting/issues
Select a method from PC, SIR and DR to do point prediction
Description
Select a method from PC, SIR and DR to do point prediction
Usage
SF(
y,
X,
newX = NULL,
K = "default",
L = 1,
method = "SIR.LM",
hyperparameter = list()
)
Arguments
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 |
Value
Out-of-sample forecast for newX
; or in-sample forecast for the last
observed data point if newX
is NULL
References
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.
Examples
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
Description
Conformal inference of the sufficient forecasting
Usage
SF.CI(
y,
X,
newX = NULL,
type = "LM",
K = "default",
L = 1,
alpha = 0.1,
discretization = TRUE,
nslices = 10
)
Arguments
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) |
Value
A list with components
- yhat
Out-of-sample forecast for
newX
; or in-sample forecast for the last observed data point ifnewX
isNULL
- ci_lower
Lower bound of conformal interval
- ci_upper
Upper bound of conformal interval
References
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.
Examples
utils::data(dataExample,package = "sufficientForecasting")
SF.CI(dataExample$y,dataExample$X,type = "LM",alpha = 0.05)
Directional regression for sufficient forecasting
Description
Directional regression for sufficient forecasting
Usage
SF.DR(y, X, newX = NULL, K = "default", L = 1, etaopg = "default", nslices = 3)
Arguments
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) |
Value
Out-of-sample forecast for newX
; or in-sample forecast for the last
observed data point if newX
is NULL
References
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.
Examples
utils::data(dataExample,package = "sufficientForecasting")
SF.DR(dataExample$y,dataExample$X,dataExample$newX)
Principal component regression for sufficient forecasting
Description
Principal component regression for sufficient forecasting
Usage
SF.PC(y, X, newX = NULL, K = "default", L = "default")
Arguments
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 = |
Value
Out-of-sample forecast for newX
; or in-sample forecast for the last
observed data point if newX
is NULL
Examples
utils::data(dataExample,package = "sufficientForecasting")
SF.PC(dataExample$y,dataExample$X)
Sliced inverse regression for sufficient forecasting
Description
Sliced inverse regression for sufficient forecasting
Usage
SF.SIR(
y,
X,
newX = NULL,
type = "LM",
K = "default",
L = 1,
discretization = TRUE,
nslices = 10
)
Arguments
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) |
Value
Out-of-sample forecast for newX
; or in-sample forecast for the last
observed data point if newX
is NULL
References
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.
Examples
utils::data(dataExample,package = "sufficientForecasting")
SF.SIR(dataExample$y,dataExample$X,type = "LLM")
A simulated dataset
Description
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.
Usage
dataExample
Format
-
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
Description
Estimate the number of common factors K
Usage
getK(y, X, Kmax = 12)
Arguments
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) |
Value
Estimate of K
References
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.