predict.SDFMFit: Generic plotting function for SDFMFit S3 objects

predict.SDFMFitR Documentation

Generic plotting function for SDFMFit S3 objects

Description

Predict all missing observations due to ragged edges in the data set plus horizon steps ahead.

Usage

## S3 method for class 'SDFMFit'
predict(object, horizon = 0, ...)

Arguments

object

SDFMFit object.

horizon

Number of forecasting steps into the future. Must be smaller than or equal to x$factor_fcast_horizon.

...

Additional parameters for the prediction function.

Value

A named list of plot objects:

data

Object containing the original data. The object inherits its class from object$data: If data is provided as zoo, data will be a zoo object. If data is provided as matrix, data will be a (no_of_factors\timesno_of_obs) matrix.

data_missing_pred

Object containing only the predictions of all missing observations plus the forecasts. Inherits its class from object$data as above.

data_imputed

Object containing the observed data, predictions of all missing observations plus the forecasts. Inherits its class from object$data as above.

Author(s)

Domenic Franjic

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)


TwoStepSDFM documentation built on May 19, 2026, 9:07 a.m.