movingstd & movingstd2

版本 1.4.0.0 (3.5 KB) 作者: John D'Errico
A (fast) windowed std on a time series (or array)
12.1K 次下载
更新 2016/4/8

查看许可证

Occasionally I see a request for computation of a running, windowed standard deviation. This is easily accomplished using filter and the alternative formula for the standard deviation:
std = sqrt((sum(x.^2) - n*xbar.^2)/(n-1)).
movingstd allows you to specify forward, backward or central windows of any desired length. It patches the ends, shortening the window as necessary.
movingstd2 is now included, allowing a moving window standard deviation on 2-dimensional arrays. (I suppose I could easily enough implement movingstdn if that becomes of interest.)

引用格式

John D'Errico (2026). movingstd & movingstd2 (https://ww2.mathworks.cn/matlabcentral/fileexchange/9428-movingstd-movingstd2), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R14SP1
兼容任何版本
平台兼容性
Windows macOS Linux
致谢

启发作品: slidefun

版本 已发布 发行说明
1.4.0.0

movingstd2 included

1.3.0.0

strncmpi instead of strmatch for tests
Pre-centered and pre-scaled now

1.2.0.0

Fix the case of complex std results due to floating point arithmetic.

1.1.0.0

Documentation change to explicitly state the behavior at the end of the series.