필터 지우기
필터 지우기

Moving Std Dev for 20 periods

조회 수: 1 (최근 30일)
Héctor Luna Enríquez
Héctor Luna Enríquez 2022년 8월 22일
답변: Chunru 2022년 8월 22일
I Have a (3000,100) Matrix containing the Returns of 3,000 companies for 100 periods (there are some nan values), and i'd like to compute volatility (std dev) for each company, for 20 periods. This is, first the average from period 1 to period 20 for company i, next the average from period 2 to period 21 and so on for each company.
Thanks for the support

답변 (1개)

Chunru
Chunru 2022년 8월 22일
a = randn(3000, 100);
b = movstd(a, 20, 0, 2, 'omitnan');

카테고리

Help CenterFile Exchange에서 Financial Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by