# \donttest{
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
# }
Run the code above in your browser using DataLab