# MOVSTD

## Purpose:

Calculates the moving standard deviation of a series.

## Syntax:

MOVSTD(series, N, rampflag, mode)

series

-

A series or table.

N

-

An integer, the number of points to compute the standard deviation as the series is processed.

rampflag

-

Optional. An integer, endpoint averaging flag.

 0: down 1: up (default)

mode

-

Optional. An integer, the normalization mode. For N = length(series):

 0: Normalize by 1/(N-1) (default) 1: Normalize by 1/N

## Returns:

A series or table.

## Example:

W1: {1, 2, 4, 7}

W2: movstd(W1, 3)

returns the series {0, 0.612, 1.528, 2.517, 1.837, 0}

W3: movstd(W1, length(W1))

W3[length(w1)] == stdev(w1) == 2.645751

## Remarks:

MOVSTD computes the moving standard deviation. For each section of length N, the sample standard deviation value (mode == 0) is defined as:

where the arithmetic mean is defined as:

The population standard deviation (mode == 1) is defined as: