Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rNew = [0]*len(data1)/25
- #Forlykkja hér
- For i in range(len(data1)/25):
- S = std(data1[i:i+25])*sqrt(252); %Standard deviation for assets
- C = cov(data1[i:i+25])*252; %Annual Covariance
- r = mean(data1[i:i+25])*252; %Annual asset return
- minR = (e*inv(C)*r') / (e*inv(C)*e') %expected return of min-var portfolio
- AminR = (e*inv(C)) / (e*inv(C)*e') %Asset allocation for min-var portfolio
- varminR = 1 / (e*inv(C)*e') %Varinace of min-var portfolio
- stdminR = 1 / (sqrt(e*inv(C)*e')) %standard deviation of min-var portfolii
- rNew = r'*w %the demand that the portfolio delivers the returns
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement