| residuals.dfm {dfms} | R Documentation | 
DFM Residuals and Fitted Values
Description
The residuals \textbf{e}_t = \textbf{x}_t - \textbf{C} \textbf{F}_t or fitted values \textbf{C} \textbf{F}_t of the DFM observation equation.
Usage
## S3 method for class 'dfm'
residuals(
  object,
  method = switch(object$em.method, none = "2s", "qml"),
  orig.format = FALSE,
  standardized = FALSE,
  na.keep = TRUE,
  ...
)
## S3 method for class 'dfm'
fitted(
  object,
  method = switch(object$em.method, none = "2s", "qml"),
  orig.format = FALSE,
  standardized = FALSE,
  na.keep = TRUE,
  ...
)
Arguments
| object | an object of class 'dfm'. | 
| method | character. The factor estimates to use: one of  | 
| orig.format | logical.  | 
| standardized | logical.  | 
| na.keep | logical.  | 
| ... | not used. | 
Value
A matrix of DFM residuals or fitted values. If orig.format = TRUE the format may be different, e.g. a data frame.
Examples
library(xts)
# Fit DFM with 3 factors and 3 lags in the transition equation
mod = DFM(diff(BM14_M), r = 3, p = 3)
# Residuals
head(resid(mod))
plot(resid(mod, orig.format = TRUE)) # this is an xts object
# Fitted values
head(fitted(mod))
head(fitted(mod, orig.format = TRUE)) # this is an xts object