czielinski / portfolioopt Goto Github PK
View Code? Open in Web Editor NEWFinancial Portfolio Optimization Routines in Python
License: MIT License
Financial Portfolio Optimization Routines in Python
License: MIT License
Hi,
I want to install portfolioopt using pip, But I keep getting the same error.
This is the error:
Failed building wheel for cvxopt
I have looked up forums and installed all possible extensions of Microsoft Visual Studio 2017 with C++, but it is still not working.
What else do I need to do to install cvopt properly?
Many thanks in advance.
Hi, thanks for your efforts and works.
the copy of example.py is not working on the fresh installation of the package. it throws an error indicating cvxopt.base
library does not exist.
I think this is because of several changes that have been made since version 1.1 of cvxopt
library.
for example, all of the functions of base
class now are accessible directly from cvxopt
library.
I tried to change all the imports which had base
in their address in the init file but it did not help I think some of the function names may have changed since. eg ediv-> div.
after all this, I would be very glad if you let me know of the changes you maybe are gonna make to your library. and I would be very glad if you let me know if there is a need for contribution.
Hello,
First thank you for sharing your work. I am using the code and find it helpful to me. One thing i am not having success with is incorporating many asset classes. In the create_test_data function the number of assets is 5. I understand how to increase the number but am finding a portfolio with many assets and small weights. I need to constrain the model to set a max and min weight to asset classes. I am trying to find the efficient frontier and create a portfolio with assets selection/population of around 150 but want to limit the weight of a specific asset to a specific number for example 5%. 100/5 = 20 so i am trying to find a fund of only 20 with 150 selections to choose from. I am writing in the hopes that you know a simple and elegant solution. My solutions have not been optimal. Thanks in advanced and i understand if you are busy.
Hey there Christian,
we use your tool and get the same results as you do.
But when i calculate the portfolio-weights with my Excel-Solver i get different results.
Maybe the reason is that we calculate the average differently.
When i calculate the average returns for asset_a in Excel i get 0,008056.
In your examply.py the average for asset_a is -0,001237.
Can you please tell me how you get this average?
Thank you in advance and thank you for the good work!
LinkFoxMario64
Hello Christian,
I've been looking at this repo for a while and got confused by the below comment in "def tangency_portfolio",
# exp_rets*x >= 1
I'm wondering why it should be the case, as I can only think about the expected return of the portfolio should be larger than risk free rate and it is much smaller than one.
Thanks,
Michelle
Hi Christian Zielinski,
I like your package and i would like to use it for my portfolio.
So, i wish use my own data.
In your exemple.py, your import your data like:
def main():
returns, cov_mat, avg_rets = pfopt.create_test_data()
I try with my pandas dataframe data m:
m=
Out[92]:
Returna Returnb Returnc Returnd
Date
2017-01-05 -0.007472 -0.007472 -0.007472 -0.007472
2017-01-06 0.014726 0.014726 0.014726 0.014726
2017-01-09 -0.008241 -0.008241 -0.008241 -0.008241
2017-01-10 -0.001318 -0.001318 -0.001318 -0.001318
...
len(m)
Out[95]: 98
type(m)
Out[96]: pandas.core.frame.DataFrame
So i tried to change your code like:
def main():
returns, cov_mat, avg_rets = m
and i have the error:
Traceback (most recent call last):
File "", line 70, in
main()
File "", line 22, in main
returns, cov_mat, avg_rets = m
ValueError: too many values to unpack
If you can to help me, i thanks you a lot.
Thanks in advance for your work.
As mentioned in the issue title I'm failing the building wheel for cvxopt.
I'm on a Windows 7 system and I'm installing to a Python 3.5 environment with:
pip3 install portfolioopt
If you need further info let me know.
Thx
Hi how should i change the come to cap they waithe at 10% for the portfolio for example.
thx a lot
Fons
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.