braverock / braverock/FactorAnalytics

plot.ffm, some chart options not working

Open
#70 4 comments 0 reactions 3 assignees Assigned to @kecoli View on GitHub
bug
Dominant language
R
Stars
85
Forks
63
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.