使用Python中的投资组合优化方法的Finance Lib [英] Finance Lib with portfolio optimization method in python

查看:460
本文介绍了使用Python中的投资组合优化方法的Finance Lib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找python中的财务库,该库提供一种类似于MATLAB

I'm looking for a finance library in python which offers a method similar to the MATLAB's portalloc . It is used to optimize a portfolio.

推荐答案

如果您知道线性代数,那么有一个简单的函数可以解决任何库都应支持的优化问题.不幸的是,自从我研究以来已经很久了,我无法告诉您公式或支持该公式的库,但是需要进行一些研究才能揭示出来.要点是任何线性代数库都应该这样做.

If you know linear algebra, there is a simple function for solving the optimization problem which any library should support. Unfortunately, it's been so long since I researched it I can't tell you the formula nor a library that supports it, but a little research should reveal it. The main point is that any linear algebra library should do.

更新:

这是我找到的帖子的引文.

Here's a quote from a post I found.

一些研究表明,平均方差投资组合优化"可以 给出好的结果.我在一条消息中对此进行了讨论

Some research says that "mean variance portfolio optimization" can give good results. I discussed this in a message

要实施此方法,所需的输入为的协方差矩阵 回报,这需要历史股票价格,这可以从中获得 使用"Python报价采集器" http://www.openvest.org/Databases/ovpyq .

To implement this approach, a needed input is the covariance matrix of returns, which requires historical stock prices, which one can obtain using "Python quote grabber" http://www.openvest.org/Databases/ovpyq .

对于预期收益-hmmm.我引用的其中一篇论文发现 假设所有股票的期望收益均等,则可以得出合理的 结果.

For expected returns -- hmmm. One of the papers I cited found that assuming equal expected returns of all stocks can give reasonable results.

然后需要一个二次编程"求解器,该求解器似乎是 由CVXOPT Python程序包处理.

Then one needs a "quadratic programming" solver, which appears to be handled by the CVXOPT Python package.

如果有人用Python实现该方法,我很高兴听到 关于它.

If someone implements the approach in Python, I'd be happy to hear about it.

R中有一个回测"包(可调用的开源统计信息包 来自Python) http://cran.r-project.org/web/packages/backtest/index.html 用于探索基于投资组合的金融工具假设 (股票,债券,掉期,期权等)."

There is a "backtest" package in R (open source stats package callable from Python) http://cran.r-project.org/web/packages/backtest/index.html "for exploring portfolio-based hypotheses about financial instruments (stocks, bonds, swaps, options, et cetera)."

这篇关于使用Python中的投资组合优化方法的Finance Lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆