exdqlmForecast: k-step-ahead Forecast

View source: R/exdqlmForecast.R

exdqlmForecastR Documentation

k-step-ahead Forecast

Description

The function estimates and plots the k-step-ahead forecasted quantile distribution from the filtered quantile estimates.

Usage

exdqlmForecast(
  y,
  start.t,
  k,
  m1,
  fFF = NULL,
  fGG = NULL,
  plot = TRUE,
  add = FALSE,
  cols = c("purple", "magenta"),
  cr.percent = 0.95
)

Arguments

y

A univariate time-series.

start.t

Time index at which to start the forecast.

k

Number of k-steps-ahead to forecast.

m1

An object of class "exdqlm".

fFF

State vector for the forecast steps. fFF must have either 1 (non-time-varying) or k (time-varying) columns. The dimension of fFF must match the estimated exdqlm in m1.

fGG

Evolution matrix for the forecast steps. fGG must be either a matrix (non-time-varying) or an array of depth k (time-varying). The dimensions of fGG must match the estimated exdqlm in m1.

plot

If TRUE the forecasted quantile estimates and 95% credible intervals are plotted, along with the filtered quantile estimates and 95% credible intervals for reference. Default is TRUE.

add

If TRUE, the forecasted quantile will be added to the existing plot. Default is FALSE.

cols

Two colors used to plot filtered and forecasted quantile estimates respectively. Default is c("purple","magenta").

cr.percent

Percentage used in the calculation of the credible intervals.

Value

A list containing the following is returned:

  • fa - The forecasted state mean vectors.

  • fR - The forecasted state covariance matrices.

  • ff - The forecasted quantile mean estimates.

  • fQ - The forecasted quantile variances.

Examples


y = scIVTmag[1:100]
model = polytrendMod(1,quantile(y,0.85),10)
M0 = exdqlmISVB(y,p0=0.85,model,df=c(0.98),dim.df = c(1),
                   gam.init=-3.5,sig.init=15)
exdqlmForecast(y,start.t=90,k=10,M0)



exdqlm documentation built on Feb. 16, 2023, 7:29 p.m.