% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/TwoStepSDFM.R
\name{predict.SDFMFit}
\alias{predict.SDFMFit}
\title{Generic plotting function for SDFMFit S3 objects}
\usage{
\method{predict}{SDFMFit}(object, horizon = 0, ...)
}
\arguments{
\item{object}{\code{SDFMFit} object.}

\item{horizon}{Number of forecasting steps into the future. Must be smaller
than or equal to \code{x$factor_fcast_horizon}.}

\item{...}{Additional parameters for the prediction function.}
}
\value{
A named list of plot objects:
\describe{
\item{data}{Object containing the original data. The object inherits its
class from \code{object$data}: If data is provided as \code{zoo}, \code{data} will be a
\code{zoo} object. If \code{data} is provided as matrix, \code{data} will be a
(\code{no_of_factors}\eqn{\times}{x}\code{no_of_obs}) matrix.}
\item{data_missing_pred}{Object containing only the predictions of all
missing observations plus the forecasts. Inherits its class from
\code{object$data} as above.}
\item{data_imputed}{Object containing the observed data, predictions of
all missing observations plus the forecasts. Inherits its class from
\code{object$data} as above.}
}
}
\description{
Predict all missing observations due to ragged edges in the data set plus
horizon steps ahead.
}
\examples{
data(factor_model)
no_of_vars <- dim(factor_model$data)[2]
no_of_factors <- dim(factor_model$factors)[2]
sdfm_fit <- twoStepSDFM(data = factor_model$data, delay = factor_model$delay,
                        selected = rep(floor(0.5 * no_of_vars), no_of_factors),
                        no_of_factors = no_of_factors, fcast_horizon = 5)
dfm_fit <- twoStepDenseDFM(data = factor_model$data, delay = factor_model$delay, 
                           no_of_factors = no_of_factors, fcast_horizon = 5)
predict(sdfm_fit, horizon = 5)
predict(dfm_fit, horizon = 5)

}
\author{
Domenic Franjic
}
