PhilBoileau / cvCovEst

An R package for assumption-lean covariance matrix estimation in high dimensions
https://philboileau.github.io/cvCovEst/
Other
13 stars 4 forks source link

Plot summary #33

Closed bcollica closed 3 years ago

bcollica commented 3 years ago

Updating pull request to merge plot_summary branch into master. Tests have been added, and descriptions have been updated. One final thing will be to add a 'Details' section in both the main plot and summary functions, but this can come later, along with examples.

PhilBoileau commented 3 years ago

I'm going to write out a few comments and questions as I go through the review. Some are targeted at specific sections of code, others are more general (listed here). No need to address these right away, we should meet to discuss them first.

bcollica commented 3 years ago

Hey all, these are the changes I've implemented so far:

Things not yet changed:

Let me know what you guys think about data for examples and anything else that comes to mind.

Brian

PhilBoileau commented 3 years ago

This is great Brian, thank you so much for all your work! If you're alright with it, I can take a stab at the first two remaining points on your to-do list this weekend. We can then meet this week to discuss the implementation of examples, and go over any remaining questions that you have. And that sounds like a good strategy regarding styler!

bcollica commented 3 years ago

Sounds good, Phil. The main issue with the multiHyperrisk function is passing arguments to filter, factorize, and arrange the data as needed depending on which estimator(s) are specified. If that information can be stored at a higher level in the function and then successfully passed down to the other functions like ggplot then the code can be much shorter. I know these tidyverse functions can be difficult to work around with their lazy evaluation, so if you have any thoughts I'm definitely open to suggestions.

PhilBoileau commented 3 years ago

I've taken a closer look at the plotting functions' code (but haven't touched anything), and I think that the first step in increasing its maintainability might be to wrap estimator-related code in standalone functions. These functions can then be called by the various summary and plotting functions as needed. We can then refactor these functions at some point in the future to take advantage of rlang functionality.

Here are two suggestions:

I'm sure that you can think of more examples, but these suggestions should be relatively painless to implement, and address the most challenging tasks remaining in this PR.

Let me know what you think. @nhejazi, your thoughts on this would also be much appreciated. I don't want to lead Brian down the wrong path.

Again, thank you for all your work on this!

bcollica commented 3 years ago

Just pushed those changes including separate plotting functions that are specific to estimators with multiple hyperparameters. Also included a estAttributes function to cut down hard coding.

PhilBoileau commented 3 years ago

This looks great! Thanks for making fast work of these requests.

nhejazi commented 3 years ago

LGTM! There's a few minor comments to address/discuss, but I'm good with merging after we've re-synced this with master and resolved those comments. This will be great functionality to have! I didn't see anything about it in the vignette, but we should eventually add a section there about this.