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

Supporting passing in weights #10

Open
rofinn opened this issue Dec 3, 2018 · 9 comments
Open

Supporting passing in weights #10

rofinn opened this issue Dec 3, 2018 · 9 comments
Labels
api enhancement New feature or request

Comments

@rofinn
Copy link
Collaborator

rofinn commented Dec 3, 2018

It might be nice to support a lower level fit and transform API on top of just cov. This would allow folks to pass in an existing covariance matrix that they'd like to apply an estimation method to (e.g., a weighted covariance).

@rofinn rofinn changed the title Multilevel API Lower level API Dec 3, 2018
@mateuszbaran
Copy link
Owner

I don't quite understand how would that work. Implemented formulas for covariance shrinkage assume normal covariance and a specific shrinkage target. Wouldn't using weighted covariance lead to wrong shrinkage coefficients?

@rofinn
Copy link
Collaborator Author

rofinn commented Dec 8, 2018

Hmmm, good point. I guess the R corpcor just lets you pass in the weights with a data matrix rather than precomputed values.

@rofinn rofinn changed the title Lower level API Supporting passing in weights Dec 8, 2018
@mateuszbaran
Copy link
Owner

StatsBase.jl has its own approach to weights and it looks nicer. I think it would be good to have a similar design here.

@tlienart tlienart added enhancement New feature or request api labels Dec 25, 2018
mateuszbaran added a commit that referenced this issue Dec 26, 2018
Support for weights from StatsBase.jl in simple estimators (see #10 f…
@nickrobinson251
Copy link
Contributor

Supporting weights, following the StatsBase API of cov(ce::CovarianceEstimator, X::AbstractMatrix, w::AbstractWeights), would be really useful :)

@mateuszbaran
Copy link
Owner

Yes, it would be very useful, but I still don't know if it's even possible to have generic implementation for all types of weights. Frequency weights should be relatively easy to support though. What kind of weights do you need?

@nickrobinson251
Copy link
Contributor

I believe AnalyticWeights. But also I am not sure weighted Lediot-Wolf is possible (I was hoping it was)

@mateuszbaran
Copy link
Owner

Unfortunately, I don't know how to modify Ledoit-Wolf to make it work with AnalyticWeights. If you find a paper about it, I will definitely like to see it.

@nickrobinson251
Copy link
Contributor

My colleague tells me it is not possible (or at least the proof in the LW paper breaks down when weights are added) ...but i've not done the working myself nor seen a paper on it.

@rofinn
Copy link
Collaborator Author

rofinn commented Jul 2, 2019

NOTE: a potential work around could be to collect a weighted sampling first and then estimate the covariance from that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants