| nmfkc.ar.predict | R Documentation |
nmfkc.ar.predict computes multi-step-ahead forecasts for a fitted NMF-VAR model
using recursive forecasting.
If the fitted model contains time series property information (from nmfkc.ar),
the forecasted values will have appropriate time-based column names.
nmfkc.ar.predict(x, Y, degree = NULL, n.ahead = 1)
x |
An object of class |
Y |
The historical observation matrix used for fitting (or at least the last |
degree |
Optional integer. Lag order (D). If |
n.ahead |
Integer (>=1). Number of steps ahead to forecast. |
A list with components:
pred |
A |
time |
A numeric vector of future time points corresponding to the columns of |
nmfkc, nmfkc.ar
# Forecast AirPassengers
d <- AirPassengers
ar_data <- nmfkc.ar(d, degree = 2)
result <- nmfkc(ar_data$Y, ar_data$A, rank = 1)
pred <- nmfkc.ar.predict(result, Y = matrix(d, nrow = 1), degree = 2, n.ahead = 3)
pred$pred
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.