Closed Ann-eat-apple closed 2 years ago
can you please give us an example usage of BlackLittermanModel?
Hi @Ann-eat-apple,
There is a walkthrough in the docs. Could you let me know if that doesn't work for you?
Cheers, Robert
# viewdict = {"AAPL": 0.20, "BBY": -0.30, "BAC": 0, "SBUX": -0.2, "T": 0.15}
S = risk_models.risk_matrix(market_prices)
bl = BlackLittermanModel(S) #### HERE IS THE ERROR
Error is:
*** TypeError: Q must be an array or dataframe
@robertmartin8
Have you had a chance to look at the docs? You aren’t passing any views to BlackLittermanModel. Please check this section: https://pyportfolioopt.readthedocs.io/en/latest/BlackLitterman.html#views
Closing for now as I believe this is addressed in the docs and example notebooks Feel free to reopen if not
What are you trying to do? Clear description of the problem you are trying to solve with PyPortfolioOpt
from pypfopt import black_litterman from pypfopt.black_litterman import BlackLittermanModel from pypfopt.efficient_frontier import EfficientFrontier
It gave me this error:
*** TypeError: Q must be an array or dataframe
on line 3What have you tried?
What data are you using? What asset class, how many assets, how many data points. Preferably provide a sample of the dataset as a csv attachment.