Skip to content

plot.ffm, some chart options not working #70

@JustinMShea

Description

@JustinMShea

With the following example:

https://github.com/braverock/FactorAnalytics/blob/master/R/plot.ffm.R#L111-L122


data(factorDataSetDjia5Yrs)
# fit a fundamental factor model
exposure.vars <- c("P2B", "MKTCAP")
fit.style.sector <- fitFfm(data=factorDataSetDjia5Yrs, asset.var="TICKER", 
                           ret.var="RETURN", date.var="DATE", 
                           exposure.vars=exposure.vars)

plot(fit.style.sector)

Make a plot selection (or 0 to exit): 

 1: Distribution of factor returns
 2: Factor exposures from the last period
 3: Actual and Fitted asset returns
 4: Time-series of R-squared values
 5: Residual variance across assets
 6: Scatterplot matrix of residuals, with histograms, density overlays, correlations and significance stars
 7: Factor Model Residual Correlation
 8: Factor Model Return Correlation
 9: Factor Contribution to SD
10: Factor Contribution to ES
11: Factor Contribution to VaR
12: Time series of factor returns

option 3: Actual and Fitted asset returns

Error in xts(x, order.by = order.by, frequency = frequency, .CLASS = "double", : 
NROW(x) must match length(order.by)

option 4: Time-series of R-squared values

Doesn't have an error, but chart isn't produced

option 8: Factor Model Return Correlation

rror in cov2cor(fmCov(x)[a.sub, a.sub]) : 
'V' is not a square numeric matrix

Also some, slightly different issues with data.table methodology.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions