FactorModelSigma -> FactorModelCovariance
Closed this issue · 3 comments
Hi @enzbus,
I noticed the implementation of FactorModelSigma
(renamed as FactorModelCovariance
) has changed from F D F^T
to F F^T
where F is factor loadings, and D was the factor sigma (or factor covariance).
Just curious any reasons? I can try implement and send PR to add factor_Sigma back, but prior to that, may I make sure if any bottlenecks you've experienced?
Old implementation -
cvxportfolio/cvxportfolio/risks.py
Lines 157 to 162 in 1786671
New implementation:
cvxportfolio/cvxportfolio/risks.py
Lines 295 to 304 in a94f9c1
Thanks,
Hi, you are right thanks for your comment. It's just a matter of simplification, you can always take a square root decomposition (like np.linalg.cholesky
) of the factor Sigma and matrix multiply it by F to fit in this new framework (that would be done internally if I implement the change you suggest). I can add it as an optional argument to the constructor, maybe it's easier.
It's also a bit more difficult (not a one liner change) because of the new implementation with cvxpy parameters, it restricts the allowed syntax. Let me think about it, I'll make a fix.
Hello, this has been added with commit 7827bc6 , I'll make a release probably today. I also clarified the various combination of arguments in the docstring.
Thank you very much