Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot.ffm, some chart options not working #70

Open
JustinMShea opened this issue Dec 13, 2021 · 4 comments
Open

plot.ffm, some chart options not working #70

JustinMShea opened this issue Dec 13, 2021 · 4 comments
Assignees
Labels

Comments

@JustinMShea
Copy link
Collaborator

JustinMShea commented Dec 13, 2021

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.

@martinrd3D
Copy link
Collaborator

Having reviewed more of the plot.ffm examples in the vignette code Doug_versionOfSangeetha_fitFfmVignette.R, I am near to concluding that we should just do away with plot.ffm, But I will check the examples in the plot.ffm man page and see if I can
get them all to work - with Kirk's help. In that case we can just leave plot.ffm in FA for now.

@JustinMShea
Copy link
Collaborator Author

JustinMShea commented Dec 22, 2021

Ok @martinrd3D , just let me know. Any additional updates here? I'll just move it into "Under Review" on the board for now.

@martinrd3D
Copy link
Collaborator

martinrd3D commented Dec 22, 2021 via email

@JustinMShea
Copy link
Collaborator Author

@kecoli I believe your recent PR #82 was to partially fix this issue, though we still have more items to go here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants