View source: R/exdqlmForecast.R
exdqlmForecast | R Documentation |
Computes filtered and k
-step-ahead forecast quantiles from a fitted
dynamic quantile model and optionally adds them to an existing plot.
exdqlmForecast(
y,
start.t,
k,
m1,
fFF = NULL,
fGG = NULL,
plot = TRUE,
add = FALSE,
cols = c("purple", "magenta"),
cr.percent = 0.95
)
y |
A univariate numeric time series (vector or |
start.t |
Integer index at which forecasts start (must be within the span of the fitted model in |
k |
Integer; number of steps ahead to forecast. |
m1 |
A fitted exDQLM model object, typically returned by |
fFF |
Optional state vector(s) for the forecast steps. A numeric matrix with
|
fGG |
Optional evolution matrix/matrices for the forecast steps. Either a numeric
|
plot |
Logical; if |
add |
Logical; if |
cols |
Character vector of length 2 giving the colors for filtered and forecasted
quantiles respectively. Default |
cr.percent |
Numeric in |
A list with components:
fa
Forecast state mean vectors (p \times k
matrix).
fR
Forecast state covariance matrices (p \times p \times k
array).
ff
Forecast quantile means (length-k
numeric).
fQ
Forecast quantile variances (length-k
numeric).
# Toy example; keep small and fast
y <- scIVTmag[1:100]
model <- polytrendMod(1, stats::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, m1 = M0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.