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

add simple example showcasing the need for the SCRIP algorithm #6

Open
mirca opened this issue Apr 9, 2020 · 1 comment
Open

add simple example showcasing the need for the SCRIP algorithm #6

mirca opened this issue Apr 9, 2020 · 1 comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@mirca
Copy link
Member

mirca commented Apr 9, 2020

like we did in the R package, we should show examples where general solvers (from e.g., scipy.optimize) are not able to or are too slow to solve the non-convex risk parity formulation.

@mirca mirca added documentation Improvements or additions to documentation good first issue Good for newcomers labels Apr 9, 2020
@mtsokol
Copy link

mtsokol commented Feb 10, 2021

Hi @mirca!

I'm a master program CS student and I was searching in jax dependency graph for projects using it to learn it's usage.
I came across this repository and after inspecting it I would like to learn more and try contributing.

Is this issue free to take?


As I understand the goal here is to show performance comparison between SCRIP and scipy.optimize solvers, similarly to the example in riskParityPortfolio documentation for risk concentration only example. Is that correct?

Following the derivation from presentation I used SLSQP solver from scipy.optimize because it's the only one that supports both equality and inequality constraints.

I made a PoC notebook, where for trick case used in tests I ran scipy solver.

Colab:
https://colab.research.google.com/drive/1KluLJd7xXD9vSeLO1ULOXF2Cwa7_PvRO?usp=sharing

nbviewer:
https://nbviewer.jupyter.org/gist/mtsokol/4743d73c086940795ba428abf0b73c1a

Although for initial points that are close to the solution it does converge, it fails for others. I used initial guess from newton_nesterov.cc from riskParityPortfolio project:

Eigen::VectorXd xk = Eigen::VectorXd::Constant(N, 1);
// initial guess
xk = std::sqrt(b.sum() / Sigma.sum()) * xk;

and I also tried b as initial guess. Unfortunately it failed for both.

Is approach in the notebook correct? Is SLSQP the right solver to use? What should be used as initial guess for that case?

After solving it I think I can try preparing speed comparison plot like from riskParityPortfolio.

Thank you for any guidance or help!

@convexfi convexfi deleted a comment from beyondstar2015 Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants