Create covariance matrix : I want to generate 50 covariance matrix for this data set, by letting the date jump on 24 days . I will let the xls file follow with
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
close all; clear all; clc;
data1 = xlsread('dataCompanyprices','Sheet1','W4:AP1203');
data = data1(:,:);
counter = 0;
for i=1:50:length(data1)
counter = counter + 1;
dd(counter,:) = data(i,:);
S = std(dd)*sqrt(252); %Standard deviation for assets
C = cov(dd)*252;
end
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!