Time series standard deviation: Defined lookback period

Dear MATLAB community,
I have monthly time series data, and would like to compute time-series standard deviations of a variable for month t, which looks at values for a defined time frame. For instance, for the last 24 observations. Thus, the standard deviation for a variable at t should be computed of the t-24 to t values of that variable.
I could not find a solution in the forum, and would be extremely grateful for any recommendations.
Optimally, it should also ignore NaNs, as my data file has quite a few missing observations, due to the nature of the data.
Thank you!
Chris

1 件のコメント

Jae Song
Jae Song 2015 年 9 月 22 日
You can try to use the nanstd(t) function where t can be a time series data with the number of observations.

サインインしてコメントする。

回答 (1 件)

Star Strider
Star Strider 2015 年 9 月 22 日

0 投票

I have no idea what your timeseries data look like, so this is just a guess. Have you used the getsamples and std (for timeseries) functions?

カテゴリ

ヘルプ センター および File ExchangeTime Series についてさらに検索

質問済み:

2015 年 9 月 21 日

回答済み:

2015 年 9 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by