Last answered:

20 Sept 2021

Posted on:

12 Sept 2021

0

Why can't I get the portfolio variance by doing this instead?

(np.dot((sec_returns.std()*250**0.5), weights)) ** 2

4 answers ( 0 marked as helpful)
Instructor
Posted on:

12 Sept 2021

0

Hi Marcus!

Thanks for reaching out.
Do you obtain the same values once you use the code provided in the lectures vis-à-vis the one you've provided here, in this question?

Looking forward to your answer.
Best,
Martin

Posted on:

13 Sept 2021

0

No I do not. I expect to though, but I don't and am wondering why not.

Posted on:

16 Sept 2021

0

Hi Martin, any idea why this is so? Looking forward to your answer, thank you.

Instructor
Posted on:

20 Sept 2021

0

Hi Marcus!

Thanks for your reply.

If Calculating Portfolio Risk is the one you are referring to, then it seems that you are referring to the standard deviation of the returns object, as opposed to the covariance obtained from its values. In other words, you need to refer to the .cov() method as opposed to .std().

Hope this helps.
Best regards,
Martin

Submit an answer