[R-SIG-Finance] fmfit in facmod in R-Forge

Arun Soni arun at sonis.eu
Wed Oct 12 22:40:37 CEST 2011


I am trying to use the default data set in the facmod package to generate a factor model but I keep getting an error "Error in as.Date.numeric(as.numeric(names(FE.hat))) : 
  'origin' must be supplied"

I have tried formatting my dates vector many ways but the error persists, I could really use some assistance in troubleshooting this problem.  Here is my R code

===================================================================================
library(facmod)
data(fmdata)
myTime<-row.names(fmdata at data)
myTime<-as.Date(myTime,"%Y-%m-%d")

myExposure<-c("LOG.MARKETCAP","BOOK2MARKET","GICS.INDUSTRY","NET.INCOME.CA172","LTDEBT.CA009")
myID<-getAssetIDs(fmdata)
myName<-getAssetLabels(fmdata)


myModel<-fmfit(fmdata, timedates=myTime, exposures=myExposure, assets=myID, wls = T, 
      regression = "classic", covariance = "classic", 
      full.resid.cov = F, robust.scale = F, 
      returnsvar = "RETURN", verbose = F)
====================================================================================

Regards

Arun


More information about the R-SIG-Finance mailing list