tirthajyoti / optimization-python Goto Github PK
View Code? Open in Web Editor NEWGeneral optimization (LP, MIP, QP, continuous and discrete optimization etc.) using Python
License: MIT License
General optimization (LP, MIP, QP, continuous and discrete optimization etc.) using Python
License: MIT License
Hello,
I am trying to maximize Sharpe with this code adding this line:
sharpe = ret / risk
just before the problem definition and changing it by:
prob = Problem(Maximize(sharpe), [sum(x)==1, x >= 0])
obtaining this problem;
DCPError: Problem does not follow DCP rules. Specifically:
The objective is not DCP. Its following subexpressions are not:
[-2.16695988e-03 -9.60588203e-04 -6.80243265e-04 -9.10794378e-04
2.84821499e-04 -1.84951106e-03 -2.41240531e-03 -2.39710967e-03
-1.59690065e-03 -1.96844915e-03 2.78261359e-03 1.32043210e-04
3.10924999e-05 -2.04406783e-03 -3.59892133e-04 7.34013179e-04
1.08369348e-03 -2.05024607e-03 1.14489241e-03 -4.87174427e-04
-9.55131222e-05 -1.19424145e-03 -2.19036230e-03 -1.10589192e-03
-2.40868247e-03 -1.45145088e-03 -3.10006405e-04 -1.55078960e-03
-2.62811048e-03 -2.54809462e-03 -6.85525210e-05 -1.73200801e-03
-2.35653381e-03 -1.32429376e-04] * var446 / QuadForm(var446, [[0.00092668 0.00036417 0.00045662 ... 0.0002323 0.00041562 0.00010376]
[0.00036417 0.00046147 0.00021776 ... 0.00024083 0.00027291 0.0001139 ]
[0.00045662 0.00021776 0.00077415 ... 0.00028546 0.00028192 0.00015766]
...
[0.0002323 0.00024083 0.00028546 ... 0.00051062 0.00027009 0.00016667]
[0.00041562 0.00027291 0.00028192 ... 0.00027009 0.00059854 0.00011856]
[0.00010376 0.0001139 0.00015766 ... 0.00016667 0.00011856 0.00044083]])
Do you have any idea to solve it?
Thanks in advance and regards
Page: Portfolio_optimization.ipynb
Please change this line:
mr.set_value(date,s,ret)
To this:
mr.at[date, s] = ret
thanks for
https://towardsdatascience.com/linear-programming-and-discrete-optimization-with-python-using-pulp-449f3c5f6e99
only you mentioned
It is noteworthy that even the widely-used SciPy has a linear optimization method built-in.
but scipy.optimize.linprog can not deal with integer optimization problem
Reference to other optimizer repos:
Reference on Datasets of USDA:
Reference on Datasets of Satiety ("Fullness"), Nutrition Density and Insulin Sensitivity (with matching Version 28 Long-Form Descriptors): https://www.kaggle.com/bradkmlee/satiety
I am trying to reimplement code in your notebooks. I get the error "PulpSolverError: Pulp: Error while executing /usr/local/lib/python3.6/dist-packages/pulp/solverdir/cbc/linux/64/cbc"
I tried checking the installations which seems to be fine. Can you suggest what might be the issue?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.