필터 지우기
필터 지우기

Calculate covariance matrix for simple example

조회 수: 16 (최근 30일)
NA
NA 2021년 11월 29일
댓글: Chunru 2021년 11월 29일
I have matrix such as
temp = [1 2 4 2 5; 100 300 200 600 100; 10 15 20 10 30]; %[A;B;C]
I want to calculate covariance of temp such that
the result should be
res = [2.7 -110 1.3; -110 43000 1.3; 13 -900 70]

채택된 답변

Chunru
Chunru 2021년 11월 29일
format longg
temp = [1 2 4 2 5; 100 300 200 600 100; 10 15 20 10 30];
res = cov(temp.')
res = 3×3
1.0e+00 * 2.7 -110 13 -110 43000 -900 13 -900 70
  댓글 수: 2
NA
NA 2021년 11월 29일
Thank you. Why does not cov(temp) work?
Chunru
Chunru 2021년 11월 29일
The cov function requires the input has the format: row representing observation, column representing variable.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time Series에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by