movmthd()

Read(238) Label: moving window, missing value,

Description:

Fill missing values with moving window method.

Syntax:

A.movmthd(window)

Note:

An external library function (See External Library Guide).

 

The function fills missing items in vector A with the moving window average whose length is window.

 

If window value is an odd number, the window’s center is the current element and the number of neighboring elements is window-1; if window value is an even number, the window’s center is the current and the previous elements.

Parameter:

A

One-dimensional sequence

window

An integer

Option:

@i

Fill missing items with median of moving window

Return value:

Sequence

Example:

 

A

 

1

=[,2.0,,3.0,4.0,5.0,,,,7.0,,9.0,,12.0,11.0]

 

2

=A1.movmthd(5)

Use the moving average whose window length is 5 to fill the missing values.

3

=A1.movmthd@i(5)

Use the moving median whose window length is 5 to fill the missing values.