AI4Finance-Foundation / AI4Finance-Foundation/Dynamic-Stock-Recommendation-Machine_Learning-Published-Paper-IEEE

A potential bug in portfolio optimization?

未關閉
#2 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Jupyter Notebook
星號
23
分支
20
PR 合併指標
30 天內沒有已合併 PR

描述

in your fundamental_portfolio.ipynb, under **"4. Potfolio Optimization using pypfopt"**, you have this two lines
` p1_return_table_pivot=p1_return_table.pivot_table(index = 'datadate',columns = 'tic', values = 'daily_return')`
` S = risk_models.sample_cov(p1_return_table_pivot)`
I think you should use
`S = risk_models.sample_cov(p1_return_table_pivot,returns_data=True)`

I am reading the documentation, sample_cov assumes the first argument to be price data rather than returns. you will have to specify returns_data=True in this case, since you're using return data directly? (let me know if I got it wrong)
https://pyportfolioopt.readthedocs.io/en/latest/RiskModels.html?highlight=sample_cov#pypfopt.risk_models.sample_cov

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。