Borrar filtros
Borrar filtros

Moving Std Dev for 20 periods

1 visualización (últimos 30 días)
Héctor Luna Enríquez
Héctor Luna Enríquez el 22 de Ag. de 2022
Respondida: Chunru el 22 de Ag. de 2022
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

Respuestas (1)

Chunru
Chunru el 22 de Ag. de 2022
a = randn(3000, 100);
b = movstd(a, 20, 0, 2, 'omitnan');

Categorías

Más información sobre Financial Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by