Title: | Bootstrap Prediction Intervals and Bias-Corrected Forecasting |
---|---|
Description: | Contains functions for bias-Corrected Forecasting and Bootstrap Prediction Intervals for Autoregressive Time Series. |
Authors: | Jae. H. Kim <[email protected]> |
Maintainer: | Jae H. Kim <[email protected]> |
License: | GPL-2 |
Version: | 1.0 |
Built: | 2025-02-23 05:16:29 UTC |
Source: | https://github.com/cran/BootPR |
The package provides alternative bias-correction methods for univariate autoregressive model parameters; and generate point forecats and prediction intervals for economic time series.
A future version will include the case of vector AR models.
Package: | BootPR |
Type: | Package |
Version: | 1.0 |
Date: | 2023-08-31 |
License: | GPL version 2 or newer |
Jae H. Kim
Maintainer: Jae H. Kim <[email protected]>
This function returns the Andrews-Chen estimates for AR coefficients, residuals, and AR forecasts generated using the Andrews-Chen estimates
Andrews.Chen(x, p, h, type)
Andrews.Chen(x, p, h, type)
x |
a time series data set |
p |
AR order |
h |
the number of forecast periods |
type |
"const" for the AR model with intercept only, "const+trend" for the AR model with intercept and trend |
coef |
Andrews-Chen median-unbiased estimates |
ecm.coef |
the coefficients in the ADF form |
resid |
residuals |
forecast |
point forecasts from Andrews-Chen estimates |
The Andrew-Chen estimator may break down when the AR order is very high. I recommend that AR order be kept low
Jae H. Kim
Kim, J.H., 2003, Forecasting Autoregressive Time Series with Bias-Corrected Parameter Estimators, International Journal of Forecasting, 19, 493-502.
Andrews, D.W. K. (1993). Exactly median-unbiased estimation of first order autoregressive / unit root models. Econometrica, 61, 139-165.
Andrews, D.W. K., & Chen, H. -Y. (1994). Approximate median unbiased estimation of autoregressive models. Journal of Business & Economic Statistics, 12, 187-204.
data(IPdata) BootBC(IPdata,p=1,h=10,nboot=200,type="const+trend")
data(IPdata) BootBC(IPdata,p=1,h=10,nboot=200,type="const+trend")
AR model selection using AIC, BIC, HQ
ARorder(x, pmax, type)
ARorder(x, pmax, type)
x |
a time series data set |
pmax |
the maximum AR order |
type |
"const" for the AR model with intercept only, "const+trend" for the AR model with intercept and trend |
ARorder |
AR orders selected by AIC, BIC and HQ |
Criteria |
the values of AIC, BIC and HQ |
Jae H. Kim
data(IPdata) ARorder(IPdata,pmax=12,type="const+trend")
data(IPdata) ARorder(IPdata,pmax=12,type="const+trend")
This function calculates bootstrap-after-bootstrap prediction intervals and bootstrap bias-corrected point forecasts
BootAfterBootPI(x, p, h, nboot, prob, type)
BootAfterBootPI(x, p, h, nboot, prob, type)
x |
a time series data set |
p |
AR order |
h |
the number of forecast periods |
nboot |
number of bootstrap iterations |
prob |
a vector of probabilities |
type |
"const" for the AR model with intercept only, "const+trend" for the AR model with intercept and trend |
PI |
prediction intervals |
forecast |
bias-corrected point forecasts |
Jae H. Kim
Kim, J.H., 2001, Bootstrap-after-Bootstrap Prediction Intervals for Autoregressive Models, Journal of Business & Economic Statistics 19, 117-128
Kilian, L. (1998). Small sample confidence intervals for impulse response functions. The Review of Economics and Statistics, 80,218-230.
data(IPdata) BootAfterBootPI(IPdata,p=1,h=10,nboot=100,prob=c(0.05,0.95),type="const+trend")
data(IPdata) BootAfterBootPI(IPdata,p=1,h=10,nboot=100,prob=c(0.05,0.95),type="const+trend")
This function returns bias-corrected parameter estimates and forecasts for univariate AR models.
BootBC(x, p, h, nboot, type)
BootBC(x, p, h, nboot, type)
x |
a time series data set |
p |
AR order |
h |
the number of forecast period |
nboot |
number of bootstrap iterations |
type |
"const" for the AR model with intercept only, "const+trend" for the AR model with intercept and trend |
coef |
Bootstrap bias-corrected parameter estimates |
resid |
residuals |
forecast |
point forecasts from bootstrap bias-corrected parameter estimates |
Jae H. Kim
Kim, J.H., 2003, Forecasting Autoregressive Time Series with Bias-Corrected Parameter Estimators, International Journal of Forecasting, 19, 493-502.
Kilian, L. (1998a). Small sample confidence intervals for impulse response functions. The Review of Economics and Statistics, 80,218-230.
data(IPdata) BootBC(IPdata,p=1,h=10,nboot=100,type="const+trend")
data(IPdata) BootBC(IPdata,p=1,h=10,nboot=100,type="const+trend")
This function returns bootstrap forecasts and prediction intervals with no bias-correction
BootPI(x, p, h, nboot, prob, type)
BootPI(x, p, h, nboot, prob, type)
x |
a time series data set |
p |
AR order |
h |
the number of forecast periods |
nboot |
number of bootstrap iterations |
prob |
a vector of probabilities |
type |
"const" for the AR model with intercept only, "const+trend" for the AR model with intercept and trend |
PI |
prediction intervals |
forecast |
bias-corrected point forecasts |
Jae H. Kim
Thombs, L. A., & Schucany, W. R. (1990). Bootstrap prediction intervals for autoregression. Journal of the American Statistical Association, 85, 486-492.
data(IPdata) BootPI(IPdata,p=1,h=10,nboot=100,prob=c(0.05,0.95),type="const+trend")
data(IPdata) BootPI(IPdata,p=1,h=10,nboot=100,prob=c(0.05,0.95),type="const+trend")
From Extended Nelson-Plosser data set, annua1, 1860-1988
data(IPdata)
data(IPdata)
Andrews, D.W. K., & Chen, H. -Y. (1994). Approximate median-unbiased estimation of autoregressive models. Journal of Business & Economic Statistics, 12, 187-204.
data(IPdata)
data(IPdata)
The function returns parameter estimates and forecasts from OLS estimation for AR models
LS.AR(x, p, h, type, prob)
LS.AR(x, p, h, type, prob)
x |
a time series data set |
p |
AR order |
h |
the number of forecast period |
prob |
a vector of probabilities |
type |
"const" for the AR model with intercept only, "const+trend" for the AR model with intercept and trend |
coef |
OLS parameter estimates |
resid |
OLS residuals |
forecast |
point forecasts from OLS parameter estimates |
PI |
Prediction Intervals based on OLS parameter estimates based on normal approximation |
Jae H. Kim
data(IPdata) LS.AR(IPdata,p=6,h=10,type="const+trend", prob=c(0.05,0.95))
data(IPdata) LS.AR(IPdata,p=6,h=10,type="const+trend", prob=c(0.05,0.95))
The function returns plots the point forecasts
Plot.Fore(x, fore, start, end, frequency)
Plot.Fore(x, fore, start, end, frequency)
x |
a time series data set |
fore |
point forecasts |
start |
starting date |
end |
ending date |
frequency |
data frequency |
frequency=1 for annual data, 4 for quarterly data, 12 for monthly data
start=c(1980,4) indicates April 1980 if frequency=12
end = c(2000,1) indicates 1st quarter of 2000 if freqeuncy = 4
plot
Jae H. Kim
data(IPdata) BootF <- BootBC(IPdata,p=1,h=10,nboot=100,type="const+trend") Plot.Fore(IPdata,BootF$forecast,start=1860,end=1988,frequency=1)
data(IPdata) BootF <- BootBC(IPdata,p=1,h=10,nboot=100,type="const+trend") Plot.Fore(IPdata,BootF$forecast,start=1860,end=1988,frequency=1)
The function returns plots the point forecasts and prediction intervals
Plot.PI(x, fore, Interval, start, end, frequency)
Plot.PI(x, fore, Interval, start, end, frequency)
x |
a time series data set |
fore |
point forecasts |
Interval |
Prediction Intervals |
start |
starting date |
end |
ending date |
frequency |
data frequency |
frequency=1 for annual data, 4 for quarterly data, 12 for monthly data
start=c(1980,4) indicates April 1980 if frequency=12
end = c(2000,1) indicates 1st quarter of 2000 if freqeuncy = 4
plot
Jae H. Kim
data(IPdata) PI <- ShamanStine.PI(IPdata,p=1,h=10,nboot=100,prob=c(0.025,0.05,0.95,0.975),type="const+trend",0) Plot.PI(IPdata,PI$forecast,PI$PI,start=1860,end=1988,frequency=1)
data(IPdata) PI <- ShamanStine.PI(IPdata,p=1,h=10,nboot=100,prob=c(0.025,0.05,0.95,0.975),type="const+trend",0) Plot.PI(IPdata,PI$forecast,PI$PI,start=1860,end=1988,frequency=1)
This function returns parameter estimates and forecasts based on Roy-Fuller medin-unbiased estimator for AR models
Roy.Fuller(x, p, h, type)
Roy.Fuller(x, p, h, type)
x |
a time series data set |
p |
AR order |
h |
the number of forecast period |
type |
"const" for the AR model with intercept only, "const+trend" for the AR model with intercept and trend |
coef |
Roy-Fuller parameter estimates |
resid |
residuals |
forecast |
point forecasts from Roy-Fuller parameter estimates |
Jae H. Kim
Kim, J.H., 2003, Forecasting Autoregressive Time Series with Bias-Corrected Parameter Estimators, International Journal of Forecasting, 19, 493-502.
Roy, A., & Fuller, W. A. (2001). Estimation for autoregressive time series with a root near one. Journal of Business & Economic Statistics, 19(4), 482-493.
data(IPdata) Roy.Fuller(IPdata,p=6,h=10,type="const+trend")
data(IPdata) Roy.Fuller(IPdata,p=6,h=10,type="const+trend")
The function returns bias-corrected forecasts and bootstrap prediction intervals using Shaman and Stine bias formula for univariate AR models
ShamanStine.PI(x, p, h, nboot, prob, type, pmax)
ShamanStine.PI(x, p, h, nboot, prob, type, pmax)
x |
a time series data set |
p |
AR order |
h |
the number of forecast periods |
nboot |
number of bootstrap iterations |
prob |
a vector of probability values |
type |
"const" for the AR model with intercept only, "const+trend" for the AR model with intercept and trend |
pmax |
for exogenous lag order algorithm, pmax = 0, for endogenous lag order algorithm, pmax is an integer greater than 0 |
PI |
prediction intervals |
forecast |
bias-corrected point forecasts |
Jae H. Kim
Kim, J.H., 2004, Bootstrap Prediction Intervals for Autoregression using Asymptotically Mean-Unbiased Parameter Estimators, International Journal of Forecasting, 20, 85-97.
Kim, J.H., 2003, Forecasting Autoregressive Time Series with Bias-Corrected Parameter Estimators, International Journal of Forecasting, 19, 493-502.
Shaman, P., & Stine, R. A. (1988). The bias of autoregressive coefficient estimators. Journal of the American Statistical Association, 83, 842-848.
Stine, R. A., & Shaman, P. (1989). A fixed point characterization for bias of autoregressive estimators. The Annals of Statistics,17, 1275-1284.
Kilian, L. (1998a). Small sample confidence intervals for impulse response functions. The Review of Economics and Statistics, 80,218-230.
data(IPdata) ShamanStine.PI(IPdata,p=1,h=10,nboot=100,prob=c(0.05,0.95),type="const+trend",pmax=0)
data(IPdata) ShamanStine.PI(IPdata,p=1,h=10,nboot=100,prob=c(0.05,0.95),type="const+trend",pmax=0)
The function returns parameter estimates and bias-corrected forecasts using Shaman and Stine bias formula for univariate AR models
Stine.Shaman(x, p, h, type)
Stine.Shaman(x, p, h, type)
x |
a time series data set |
p |
AR order |
h |
the number of forecast period |
type |
"const" for the AR model with intercept only, "const+trend" for the AR model with intercept and trend |
coef |
Bias-corrected parameter estimates using Shama-Stine formula |
resid |
residuals |
forecast |
point forecasts from bias-corrected parameter estimates |
Jae H. Kim
Kim, J.H., 2003, Forecasting Autoregressive Time Series with Bias-Corrected Parameter Estimators, International Journal of Forecasting, 19, 493-502.
Shaman, P., & Stine, R. A. (1988). The bias of autoregressive coefficient estimators. Journal of the American Statistical Association, 83, 842-848.
Stine, R. A., & Shaman, P. (1989). A fixed point characterization for bias of autoregressive estimators. The Annals of Statistics,17, 1275-1284.
Kilian, L. (1998a). Small sample confidence intervals for impulse response functions. The Review of Economics and Statistics, 80,218-230.
data(IPdata) Stine.Shaman(IPdata,p=6,h=10,type="const+trend")
data(IPdata) Stine.Shaman(IPdata,p=6,h=10,type="const+trend")