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 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by