2 ms·
just a small nitpick, you should be able to calculate portfolio variance using simple matrix operations instead of writing a double for loop. something like.
by hogu 14y ago
just a small nitpick, you should be able to calculate portfolio variance using simple matrix operations instead of writing a double for loop.
something like.
temp = a* std_dev
var = np.dot(np.dot(temp.T, cor), temp)