UniGASRoll: Rolling forecast with univariate GAS models

Description Usage Arguments Value Author(s) Examples

View source: R/Forecast.R

Description

One-step ahead rolling forecasts with model re-estimation. The function also reports several quantity for backtesting for point and density forecasts.

Usage

1
2
3
UniGASRoll(data, GASSpec, ForecastLength = 500, Nstart = NULL,
           RefitEvery = 23, RefitWindow = c("moving", "recursive"),
           cluster = NULL, Compute.SE = FALSE, ...)

Arguments

data

numeric vector containing the time series of observations.

GASSpec

An object of the class uGASSpec created using the function UniGASSpec.

ForecastLength

numeric Length of the out-of-sample.

Nstart

numeric Period when perform the first forecast. Ignored if ForecastLength is supplied.

RefitEvery

numeric Number of periods before model coefficients re-estimation.

RefitWindow

character Type of window. If RefitWindow = "recursive" all the observations are used when the model is re-estimated. If RefitWindow = "moving" old observations are eliminated.

cluster

A cluster object created calling using the paralell package. If supplied parallel processing is used to speed up the computations.

Compute.SE

logical. Should asymptotic Standard Errors be computed? By default Compute.SE = FALSE

...

Additional arguments for UniGASFit

Value

An object of the class uGASRoll.

Author(s)

Leopoldo Catania

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Specify an univariate GAS model with Student-t
# conditional distribution and time-varying location, scale and shape parameter

# Inflation Forecast

data("cpichg")
help(cpichg)

GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity",
                     GASPar = list(location = TRUE, scale = TRUE, shape = FALSE))

# Perform 1-step ahead rolling forecast with refit
library("parallel")

Roll = UniGASRoll(cpichg, GASSpec, ForecastLength = 50,
                  RefitEvery = 12, RefitWindow = c("moving"))


Roll

Example output

Attaching package: 'GAS'

The following object is masked from 'package:stats':

    residuals

cpichg                   package:GAS                   R Documentation

_D_a_t_a: _Q_u_a_r_t_e_r_l_y _l_o_g_a_r_i_t_h_m_i_c _c_h_a_n_g_e _i_n _p_e_r_c_e_n_t_a_g_e _p_o_i_n_t_s _o_f _t_h_e _C_o_n_s_u_m_e_r
_P_r_i_c_e _I_n_d_e_x _f_o_r _A_l_l _U_r_b_a_n _C_o_n_s_u_m_e_r_s: _A_l_l _I_t_e_m_s (_C_P_I_A_U_C_S_L) _f_r_o_m
_1_9_4_7-_0_4-_0_1 _t_o _2_0_1_6-_0_5-_0_1

_D_e_s_c_r_i_p_t_i_o_n:

     Quarterly logarithmic change in percentage points of the Consumer
     Price Index for All Urban Consumers: All Items (CPIAUCSL) from
     1947-04-01 to 2016-05-01 available at <URL:
     https://fred.stlouisfed.org/series/CPIAUCSL>.

_U_s_a_g_e:

     data("cpichg")
     
_F_o_r_m_a_t:

     A xts object containing 276 observations from 1947-04-01 to
     2016-05-01.

_R_e_f_e_r_e_n_c_e_s:

     US. Bureau of Labor Statistics, Consumer Price Index for All Urban
     Consumers: All Items [CPIAUCSL], retrieved from FRED, Federal
     Reserve Bank of St. Louis;
     https://fred.stlouisfed.org/series/CPIAUCSL, June 24, 2016.



------------------------------------------
-    Univariate GAS Rolling Forecast     -
------------------------------------------

Model Specification
Conditional distribution:  std
Score scaling type:  Identity
------------------------------------------
Parameters forecast:
                     location     scale    shape
2003-09-30 22:00:00 0.5733224 0.2495039 11.09637
2003-12-31 23:00:00 0.5145558 0.2002319 11.09637
2004-03-31 22:00:00 0.6705186 0.1794045 11.09637
2004-06-30 22:00:00 0.7310584 0.1486445 11.09637
2004-09-30 22:00:00 0.6738027 0.1264052 11.09637

....................
                       location     scale    shape
2014-12-31 23:00:00  0.06664124 0.1064444 6.290821
2015-03-31 22:00:00 -0.22618153 0.1345117 6.290821
2015-06-30 22:00:00  0.14312340 0.1626205 6.290821
2015-09-30 22:00:00  0.25987443 0.1571218 6.274666
2015-12-31 23:00:00  0.24841109 0.1406962 6.274666

------------------------------------------

Elapsed time: 0.09 mins

GAS documentation built on Feb. 4, 2022, 5:12 p.m.