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!