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 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!