다음: , 이전: , 상위 문서: Statistics   [차례][찾아보기]


26.2 Statistics on Sliding Windows of Data

It is often useful to calculate descriptive statistics over a subsection (i.e., window) of a full dataset. Octave provides the function movfun which will call an arbitrary function handle with windows of data and accumulate the results. Many of the most commonly desired functions, such as the moving average over a window of data (movmean), are already provided.

세로 = movfun (함수, 가로, wlen)
세로 = movfun (함수, 가로, [nb, na])
세로 = movfun (…, "property", )

Apply function 함수 to a moving window of length wlen on data 가로.

If wlen is a scalar, the function 함수 is applied to a moving window of length wlen. When wlen is an odd number the window is symmetric and includes (wlen - 1) / 2 elements on either side of the central element. For example, when calculating the output at index 5 with a window length of 3, movfun uses data elements [4, 5, 6]. If wlen is an even number, the window is asymmetric and has wlen/2 elements to the left of the central element and wlen/2 - 1 elements to the right of the central element. For example, when calculating the output at index 5 with a window length of 4, movfun uses data elements [3, 4, 5, 6].

If wlen is an array with two elements [nbna], the function is applied to a moving window -nb:na. This window includes nb number of elements before the current element and na number of elements after the current element. The current element is always included. For example, given wlen = [3, 0], the data used to calculate index 5 is [2, 3, 4, 5].

During calculations the data input 가로 is reshaped into a 2-dimensional wlen-by-N matrix and 함수 is called on this new matrix. Therefore, 함수 must accept an array input argument and apply the computation along dimension 1, i.e., down the columns of the array.

When applied to an array (possibly multi-dimensional) with n columns, 함수 may return a result in either of two formats: Format 1) an array of size 1-by-n-by-dim3-by-…-by-dimN. This is the typical output format from Octave core functions. Type demo ("movfun", 5) for an example of this use case. Format 2) a row vector of length n * numel_higher_dims where numel_higher_dims is prod (size (가로)(3:end)). The output of 함수 for the i-th input column must be found in the output at indices i:n:(n*numel_higher_dims). This format is useful when concatenating functions into arrays, or when using nthargout. Type demo ("movfun", 6) for an example of this case.

The calculation can be controlled by specifying property/ pairs. Valid properties are

"dim"

Operate along the dimension specified, rather than the default of the first non-singleton dimension.

"Endpoints"

This property controls how results are calculated at the boundaries (endpoints) of the window. Possible values are:

"shrink" (default)

The window is truncated at the beginning and end of the array to exclude elements for which there is no source data. For example, with a window of length 3, 세로(1) = 함수 (가로(1:2)), and 세로(end) = 함수 (가로(end-1:end)).

"discard"

Any 세로 values that use a window extending beyond the original data array are deleted. For example, with a 10-element data vector and a window of length 3, the output will contain only 8 elements. The first element would require calculating the function over indices [0, 1, 2] and is therefore discarded. The last element would require calculating the function over indices [9, 10, 11] and is therefore discarded.

"fill"

Any window elements outside the data array are replaced by NaN. For example, with a window of length 3, 세로(1) = 함수 ([NaN, 가로(1:2)]), and 세로(end) = 함수 ([가로(end-1:end), NaN]). This option usually results in 세로 having NaN values at the boundaries, although it is influenced by how 함수 handles NaN, and also by the property "nancond".

user_value

Any window elements outside the data array are replaced by the specified value user_value which must be a numeric scalar. For example, with a window of length 3, 세로(1) = 함수 ([user_value, 가로(1:2)]), and 세로(end) = 함수 ([가로(end-1:end), user_value]). A common choice for user_value is 0.

"same"

Any window elements outside the data array are replaced by the value of 가로 at the boundary. For example, with a window of length 3, 세로(1) = 함수 ([가로(1), 가로(1:2)]), and 세로(end) = 함수 ([가로(end-1:end), 가로(end)]).

"periodic"

The window is wrapped so that any missing data elements are taken from the other side of the data. For example, with a window of length 3, 세로(1) = 함수 ([가로(end), 가로(1:2)]), and 세로(end) = 함수 ([가로(end-1:end), 가로(1)]).

Note that for some of these choices, the window size at the boundaries is not the same as for the central part, and 함수 must work in these cases.

"nancond"

Controls whether NaN and NA values should be included (value: "includenan"), or excluded (value: "omitnan"), from the data passed to 함수. The default is "includenan". Caution: The "omitnan" option is not yet implemented.

"outdim"

A row vector that selects which dimensions of the calculation will appear in the output 세로. This is only useful when 함수 returns an N-dimensional array in Format 1. The default is to return all output dimensions.

Programming Note: The property "outdim" can be used to save memory when the output of 함수 has many dimensions, or when a wrapper to the base function that selects the desired outputs is too costly. When memory is not an issue, the easiest way to select output dimensions is to first calculate the complete result with movfun and then filter that result with indexing. If code complexity is not an issue then a wrapper can be created using anonymous functions. For example, if basefcn is a function returning a K-dimensional row output, and only dimension D is desired, then the following wrapper could be used.

함수 = @(x) basefcn (x)(:,size(x,2) * (D-1) + (1:size(x,2)));
세로 = movfun (@fcn, …);

같이 보기: movslice, prepad, postpad, permute, reshape.

slcidx = movslice (N, wlen)
[slcidx, C, Cpre, Cpost, win] = movslice (…)

Generate indices to slice a vector of length N in to windows of length wlen.

FIXME: Document inputs N, wlen

FIXME: Document outputs slcidx, C, Cpre, Cpost, win.

같이 보기: movfun.

세로 = movmad (가로, wlen)
세로 = movmad (가로, [na, nb])
세로 = movmad (…, dim)
세로 = movmad (…, "nancond")
세로 = movmad (…, property, )

Calculate the moving mean absolute deviation over a sliding window of length wlen on data 가로.

If wlen is a scalar, the function mad is applied to a moving window of length wlen. When wlen is an odd number the window is symmetric and includes (wlen - 1) / 2 elements on either side of the central element. For example, when calculating the output at index 5 with a window length of 3, movmad uses data elements [4, 5, 6]. If wlen is an even number, the window is asymmetric and has wlen/2 elements to the left of the central element and wlen/2 - 1 elements to the right of the central element. For example, when calculating the output at index 5 with a window length of 4, movmad uses data elements [3, 4, 5, 6].

If wlen is an array with two elements [nbna], the function is applied to a moving window -nb:na. This window includes nb number of elements before the current element and na number of elements after the current element. The current element is always included. For example, given wlen = [3, 0], the data used to calculate index 5 is [2, 3, 4, 5].

If the optional argument dim is given, operate along this dimension.

The optional string argument "nancond" controls whether NaN and NA values should be included ("includenan"), or excluded ("omitnan"), from the data passed to mad. The default is "includenan". Caution: the "omitnan" option is not yet implemented.

The calculation can be controlled by specifying property/ pairs. Valid properties are

"Endpoints"

This property controls how results are calculated at the boundaries (endpoints) of the window. Possible values are:

"shrink" (default)

The window is truncated at the beginning and end of the array to exclude elements for which there is no source data. For example, with a window of length 3, 세로(1) = mad (가로(1:2)), and 세로(end) = mad (가로(end-1:end)).

"discard"

Any 세로 values that use a window extending beyond the original data array are deleted. For example, with a 10-element data vector and a window of length 3, the output will contain only 8 elements. The first element would require calculating the function over indices [0, 1, 2] and is therefore discarded. The last element would require calculating the function over indices [9, 10, 11] and is therefore discarded.

"fill"

Any window elements outside the data array are replaced by NaN. For example, with a window of length 3, 세로(1) = mad ([NaN, 가로(1:2)]), and 세로(end) = mad ([가로(end-1:end), NaN]). This option usually results in 세로 having NaN values at the boundaries, although it is influenced by how mad handles NaN, and also by the property "nancond".

user_value

Any window elements outside the data array are replaced by the specified value user_value which must be a numeric scalar. For example, with a window of length 3, 세로(1) = mad ([user_value, 가로(1:2)]), and 세로(end) = mad ([가로(end-1:end), user_value]). A common choice for user_value is 0.

"same"

Any window elements outside the data array are replaced by the value of 가로 at the boundary. For example, with a window of length 3, 세로(1) = mad ([가로(1), 가로(1:2)]), and 세로(end) = mad ([가로(end-1:end), 가로(end)]).

"periodic"

The window is wrapped so that any missing data elements are taken from the other side of the data. For example, with a window of length 3, 세로(1) = mad ([가로(end), 가로(1:2)]), and 세로(end) = mad ([가로(end-1:end), 가로(1)]).

"SamplePoints"

Caution: This option is not yet implemented.

Programming Note: This function is a wrapper which calls movfun. For additional options and documentation, See movfun.

같이 보기: movfun, movslice, movmax, movmean, movmedian, movmin, movprod, movstd, movsum, movvar.

세로 = movmax (가로, wlen)
세로 = movmax (가로, [na, nb])
세로 = movmax (…, dim)
세로 = movmax (…, "nancond")
세로 = movmax (…, property, )

Calculate the moving maximum over a sliding window of length wlen on data 가로.

If wlen is a scalar, the function max is applied to a moving window of length wlen. When wlen is an odd number the window is symmetric and includes (wlen - 1) / 2 elements on either side of the central element. For example, when calculating the output at index 5 with a window length of 3, movmax uses data elements [4, 5, 6]. If wlen is an even number, the window is asymmetric and has wlen/2 elements to the left of the central element and wlen/2 - 1 elements to the right of the central element. For example, when calculating the output at index 5 with a window length of 4, movmax uses data elements [3, 4, 5, 6].

If wlen is an array with two elements [nbna], the function is applied to a moving window -nb:na. This window includes nb number of elements before the current element and na number of elements after the current element. The current element is always included. For example, given wlen = [3, 0], the data used to calculate index 5 is [2, 3, 4, 5].

If the optional argument dim is given, operate along this dimension.

The optional string argument "nancond" controls whether NaN and NA values should be included ("includenan"), or excluded ("omitnan"), from the data passed to max. The default is "includenan". Caution: the "omitnan" option is not yet implemented.

The calculation can be controlled by specifying property/ pairs. Valid properties are

"Endpoints"

This property controls how results are calculated at the boundaries (endpoints) of the window. Possible values are:

"shrink" (default)

The window is truncated at the beginning and end of the array to exclude elements for which there is no source data. For example, with a window of length 3, 세로(1) = max (가로(1:2)), and 세로(end) = max (가로(end-1:end)).

"discard"

Any 세로 values that use a window extending beyond the original data array are deleted. For example, with a 10-element data vector and a window of length 3, the output will contain only 8 elements. The first element would require calculating the function over indices [0, 1, 2] and is therefore discarded. The last element would require calculating the function over indices [9, 10, 11] and is therefore discarded.

"fill"

Any window elements outside the data array are replaced by NaN. For example, with a window of length 3, 세로(1) = max ([NaN, 가로(1:2)]), and 세로(end) = max ([가로(end-1:end), NaN]). This option usually results in 세로 having NaN values at the boundaries, although it is influenced by how max handles NaN, and also by the property "nancond".

user_value

Any window elements outside the data array are replaced by the specified value user_value which must be a numeric scalar. For example, with a window of length 3, 세로(1) = max ([user_value, 가로(1:2)]), and 세로(end) = max ([가로(end-1:end), user_value]). A common choice for user_value is 0.

"same"

Any window elements outside the data array are replaced by the value of 가로 at the boundary. For example, with a window of length 3, 세로(1) = max ([가로(1), 가로(1:2)]), and 세로(end) = max ([가로(end-1:end), 가로(end)]).

"periodic"

The window is wrapped so that any missing data elements are taken from the other side of the data. For example, with a window of length 3, 세로(1) = max ([가로(end), 가로(1:2)]), and 세로(end) = max ([가로(end-1:end), 가로(1)]).

"SamplePoints"

Caution: This option is not yet implemented.

Programming Note: This function is a wrapper which calls movfun. For additional options and documentation, See movfun.

같이 보기: movfun, movslice, movmad, movmean, movmedian, movmin, movprod, movstd, movsum, movvar.

세로 = movmean (가로, wlen)
세로 = movmean (가로, [na, nb])
세로 = movmean (…, dim)
세로 = movmean (…, "nancond")
세로 = movmean (…, property, )

Calculate the moving average over a sliding window of length wlen on data 가로.

If wlen is a scalar, the function mean is applied to a moving window of length wlen. When wlen is an odd number the window is symmetric and includes (wlen - 1) / 2 elements on either side of the central element. For example, when calculating the output at index 5 with a window length of 3, movmean uses data elements [4, 5, 6]. If wlen is an even number, the window is asymmetric and has wlen/2 elements to the left of the central element and wlen/2 - 1 elements to the right of the central element. For example, when calculating the output at index 5 with a window length of 4, movmean uses data elements [3, 4, 5, 6].

If wlen is an array with two elements [nbna], the function is applied to a moving window -nb:na. This window includes nb number of elements before the current element and na number of elements after the current element. The current element is always included. For example, given wlen = [3, 0], the data used to calculate index 5 is [2, 3, 4, 5].

If the optional argument dim is given, operate along this dimension.

The optional string argument "nancond" controls whether NaN and NA values should be included ("includenan"), or excluded ("omitnan"), from the data passed to mean. The default is "includenan". Caution: the "omitnan" option is not yet implemented.

The calculation can be controlled by specifying property/ pairs. Valid properties are

"Endpoints"

This property controls how results are calculated at the boundaries (endpoints) of the window. Possible values are:

"shrink" (default)

The window is truncated at the beginning and end of the array to exclude elements for which there is no source data. For example, with a window of length 3, 세로(1) = mean (가로(1:2)), and 세로(end) = mean (가로(end-1:end)).

"discard"

Any 세로 values that use a window extending beyond the original data array are deleted. For example, with a 10-element data vector and a window of length 3, the output will contain only 8 elements. The first element would require calculating the function over indices [0, 1, 2] and is therefore discarded. The last element would require calculating the function over indices [9, 10, 11] and is therefore discarded.

"fill"

Any window elements outside the data array are replaced by NaN. For example, with a window of length 3, 세로(1) = mean ([NaN, 가로(1:2)]), and 세로(end) = mean ([가로(end-1:end), NaN]). This option usually results in 세로 having NaN values at the boundaries, although it is influenced by how mean handles NaN, and also by the property "nancond".

user_value

Any window elements outside the data array are replaced by the specified value user_value which must be a numeric scalar. For example, with a window of length 3, 세로(1) = mean ([user_value, 가로(1:2)]), and 세로(end) = mean ([가로(end-1:end), user_value]). A common choice for user_value is 0.

"same"

Any window elements outside the data array are replaced by the value of 가로 at the boundary. For example, with a window of length 3, 세로(1) = mean ([가로(1), 가로(1:2)]), and 세로(end) = mean ([가로(end-1:end), 가로(end)]).

"periodic"

The window is wrapped so that any missing data elements are taken from the other side of the data. For example, with a window of length 3, 세로(1) = mean ([가로(end), 가로(1:2)]), and 세로(end) = mean ([가로(end-1:end), 가로(1)]).

"SamplePoints"

Caution: This option is not yet implemented.

Programming Note: This function is a wrapper which calls movfun. For additional options and documentation, See movfun.

같이 보기: movfun, movslice, movmad, movmax, movmedian, movmin, movprod, movstd, movsum, movvar.

세로 = movmedian (가로, wlen)
세로 = movmedian (가로, [na, nb])
세로 = movmedian (…, dim)
세로 = movmedian (…, "nancond")
세로 = movmedian (…, property, )

Calculate the moving median over a sliding window of length wlen on data 가로.

If wlen is a scalar, the function movmedian is applied to a moving window of length wlen. When wlen is an odd number the window is symmetric and includes (wlen - 1) / 2 elements on either side of the central element. For example, when calculating the output at index 5 with a window length of 3, movmedian uses data elements [4, 5, 6]. If wlen is an even number, the window is asymmetric and has wlen/2 elements to the left of the central element and wlen/2 - 1 elements to the right of the central element. For example, when calculating the output at index 5 with a window length of 4, movmedian uses data elements [3, 4, 5, 6].

If wlen is an array with two elements [nbna], the function is applied to a moving window -nb:na. This window includes nb number of elements before the current element and na number of elements after the current element. The current element is always included. For example, given wlen = [3, 0], the data used to calculate index 5 is [2, 3, 4, 5].

If the optional argument dim is given, operate along this dimension.

The optional string argument "nancond" controls whether NaN and NA values should be included ("includenan"), or excluded ("omitnan"), from the data passed to movmedian. The default is "includenan". Caution: the "omitnan" option is not yet implemented.

The calculation can be controlled by specifying property/ pairs. Valid properties are

"Endpoints"

This property controls how results are calculated at the boundaries (endpoints) of the window. Possible values are:

"shrink" (default)

The window is truncated at the beginning and end of the array to exclude elements for which there is no source data. For example, with a window of length 3, 세로(1) = movmedian (가로(1:2)), and 세로(end) = movmedian (가로(end-1:end)).

"discard"

Any 세로 values that use a window extending beyond the original data array are deleted. For example, with a 10-element data vector and a window of length 3, the output will contain only 8 elements. The first element would require calculating the function over indices [0, 1, 2] and is therefore discarded. The last element would require calculating the function over indices [9, 10, 11] and is therefore discarded.

"fill"

Any window elements outside the data array are replaced by NaN. For example, with a window of length 3, 세로(1) = movmedian ([NaN, 가로(1:2)]), and 세로(end) = movmedian ([가로(end-1:end), NaN]). This option usually results in 세로 having NaN values at the boundaries, although it is influenced by how movmedian handles NaN, and also by the property "nancond".

user_value

Any window elements outside the data array are replaced by the specified value user_value which must be a numeric scalar. For example, with a window of length 3, 세로(1) = movmedian ([user_value, 가로(1:2)]), and 세로(end) = movmedian ([가로(end-1:end), user_value]). A common choice for user_value is 0.

"same"

Any window elements outside the data array are replaced by the value of 가로 at the boundary. For example, with a window of length 3, 세로(1) = movmedian ([가로(1), 가로(1:2)]), and 세로(end) = movmedian ([가로(end-1:end), 가로(end)]).

"periodic"

The window is wrapped so that any missing data elements are taken from the other side of the data. For example, with a window of length 3, 세로(1) = movmedian ([가로(end), 가로(1:2)]), and 세로(end) = movmedian ([가로(end-1:end), 가로(1)]).

"SamplePoints"

Caution: This option is not yet implemented.

Programming Note: This function is a wrapper which calls movfun. For additional options and documentation, See movfun.

같이 보기: movfun, movslice, movmad, movmax, movmean, movmin, movprod, movstd, movsum, movvar.

세로 = movmin (가로, wlen)
세로 = movmin (가로, [na, nb])
세로 = movmin (…, dim)
세로 = movmin (…, "nancond")
세로 = movmin (…, property, )

Calculate the moving minimum over a sliding window of length wlen on data 가로.

If wlen is a scalar, the function min is applied to a moving window of length wlen. When wlen is an odd number the window is symmetric and includes (wlen - 1) / 2 elements on either side of the central element. For example, when calculating the output at index 5 with a window length of 3, movmin uses data elements [4, 5, 6]. If wlen is an even number, the window is asymmetric and has wlen/2 elements to the left of the central element and wlen/2 - 1 elements to the right of the central element. For example, when calculating the output at index 5 with a window length of 4, movmin uses data elements [3, 4, 5, 6].

If wlen is an array with two elements [nbna], the function is applied to a moving window -nb:na. This window includes nb number of elements before the current element and na number of elements after the current element. The current element is always included. For example, given wlen = [3, 0], the data used to calculate index 5 is [2, 3, 4, 5].

If the optional argument dim is given, operate along this dimension.

The optional string argument "nancond" controls whether NaN and NA values should be included ("includenan"), or excluded ("omitnan"), from the data passed to min. The default is "includenan". Caution: the "omitnan" option is not yet implemented.

The calculation can be controlled by specifying property/ pairs. Valid properties are

"Endpoints"

This property controls how results are calculated at the boundaries (endpoints) of the window. Possible values are:

"shrink" (default)

The window is truncated at the beginning and end of the array to exclude elements for which there is no source data. For example, with a window of length 3, 세로(1) = min (가로(1:2)), and 세로(end) = min (가로(end-1:end)).

"discard"

Any 세로 values that use a window extending beyond the original data array are deleted. For example, with a 10-element data vector and a window of length 3, the output will contain only 8 elements. The first element would require calculating the function over indices [0, 1, 2] and is therefore discarded. The last element would require calculating the function over indices [9, 10, 11] and is therefore discarded.

"fill"

Any window elements outside the data array are replaced by NaN. For example, with a window of length 3, 세로(1) = min ([NaN, 가로(1:2)]), and 세로(end) = min ([가로(end-1:end), NaN]). This option usually results in 세로 having NaN values at the boundaries, although it is influenced by how min handles NaN, and also by the property "nancond".

user_value

Any window elements outside the data array are replaced by the specified value user_value which must be a numeric scalar. For example, with a window of length 3, 세로(1) = min ([user_value, 가로(1:2)]), and 세로(end) = min ([가로(end-1:end), user_value]). A common choice for user_value is 0.

"same"

Any window elements outside the data array are replaced by the value of 가로 at the boundary. For example, with a window of length 3, 세로(1) = min ([가로(1), 가로(1:2)]), and 세로(end) = min ([가로(end-1:end), 가로(end)]).

"periodic"

The window is wrapped so that any missing data elements are taken from the other side of the data. For example, with a window of length 3, 세로(1) = min ([가로(end), 가로(1:2)]), and 세로(end) = min ([가로(end-1:end), 가로(1)]).

"SamplePoints"

Caution: This option is not yet implemented.

Programming Note: This function is a wrapper which calls movfun. For additional options and documentation, See movfun.

같이 보기: movfun, movslice, movmad, movmax, movmean, movmedian, movprod, movstd, movsum, movvar.

세로 = movprod (가로, wlen)
세로 = movprod (가로, [na, nb])
세로 = movprod (…, dim)
세로 = movprod (…, "nancond")
세로 = movprod (…, property, )

Calculate the moving product over a sliding window of length wlen on data 가로.

If wlen is a scalar, the function movprod is applied to a moving window of length wlen. When wlen is an odd number the window is symmetric and includes (wlen - 1) / 2 elements on either side of the central element. For example, when calculating the output at index 5 with a window length of 3, movprod uses data elements [4, 5, 6]. If wlen is an even number, the window is asymmetric and has wlen/2 elements to the left of the central element and wlen/2 - 1 elements to the right of the central element. For example, when calculating the output at index 5 with a window length of 4, movprod uses data elements [3, 4, 5, 6].

If wlen is an array with two elements [nbna], the function is applied to a moving window -nb:na. This window includes nb number of elements before the current element and na number of elements after the current element. The current element is always included. For example, given wlen = [3, 0], the data used to calculate index 5 is [2, 3, 4, 5].

If the optional argument dim is given, operate along this dimension.

The optional string argument "nancond" controls whether NaN and NA values should be included ("includenan"), or excluded ("omitnan"), from the data passed to movprod. The default is "includenan". Caution: the "omitnan" option is not yet implemented.

The calculation can be controlled by specifying property/ pairs. Valid properties are

"Endpoints"

This property controls how results are calculated at the boundaries (endpoints) of the window. Possible values are:

"shrink" (default)

The window is truncated at the beginning and end of the array to exclude elements for which there is no source data. For example, with a window of length 3, 세로(1) = movprod (가로(1:2)), and 세로(end) = movprod (가로(end-1:end)).

"discard"

Any 세로 values that use a window extending beyond the original data array are deleted. For example, with a 10-element data vector and a window of length 3, the output will contain only 8 elements. The first element would require calculating the function over indices [0, 1, 2] and is therefore discarded. The last element would require calculating the function over indices [9, 10, 11] and is therefore discarded.

"fill"

Any window elements outside the data array are replaced by NaN. For example, with a window of length 3, 세로(1) = movprod ([NaN, 가로(1:2)]), and 세로(end) = movprod ([가로(end-1:end), NaN]). This option usually results in 세로 having NaN values at the boundaries, although it is influenced by how movprod handles NaN, and also by the property "nancond".

user_value

Any window elements outside the data array are replaced by the specified value user_value which must be a numeric scalar. For example, with a window of length 3, 세로(1) = movprod ([user_value, 가로(1:2)]), and 세로(end) = movprod ([가로(end-1:end), user_value]). A common choice for user_value is 0.

"same"

Any window elements outside the data array are replaced by the value of 가로 at the boundary. For example, with a window of length 3, 세로(1) = movprod ([가로(1), 가로(1:2)]), and 세로(end) = movprod ([가로(end-1:end), 가로(end)]).

"periodic"

The window is wrapped so that any missing data elements are taken from the other side of the data. For example, with a window of length 3, 세로(1) = movprod ([가로(end), 가로(1:2)]), and 세로(end) = movprod ([가로(end-1:end), 가로(1)]).

"SamplePoints"

Caution: This option is not yet implemented.

Programming Note: This function is a wrapper which calls movfun. For additional options and documentation, See movfun.

같이 보기: movfun, movslice, movmad, movmax, movmean, movmedian, movmin, movstd, movsum, movvar.

세로 = movstd (가로, wlen)
세로 = movstd (가로, [na, nb])
세로 = movstd (…, dim)
세로 = movstd (…, "nancond")
세로 = movstd (…, property, )

Calculate the moving standard deviation over a sliding window of length wlen on data 가로.

If wlen is a scalar, the function movstd is applied to a moving window of length wlen. When wlen is an odd number the window is symmetric and includes (wlen - 1) / 2 elements on either side of the central element. For example, when calculating the output at index 5 with a window length of 3, movstd uses data elements [4, 5, 6]. If wlen is an even number, the window is asymmetric and has wlen/2 elements to the left of the central element and wlen/2 - 1 elements to the right of the central element. For example, when calculating the output at index 5 with a window length of 4, movstd uses data elements [3, 4, 5, 6].

If wlen is an array with two elements [nbna], the function is applied to a moving window -nb:na. This window includes nb number of elements before the current element and na number of elements after the current element. The current element is always included. For example, given wlen = [3, 0], the data used to calculate index 5 is [2, 3, 4, 5].

If the optional argument dim is given, operate along this dimension.

The optional string argument "nancond" controls whether NaN and NA values should be included ("includenan"), or excluded ("omitnan"), from the data passed to movstd. The default is "includenan". Caution: the "omitnan" option is not yet implemented.

The calculation can be controlled by specifying property/ pairs. Valid properties are

"Endpoints"

This property controls how results are calculated at the boundaries (endpoints) of the window. Possible values are:

"shrink" (default)

The window is truncated at the beginning and end of the array to exclude elements for which there is no source data. For example, with a window of length 3, 세로(1) = movstd (가로(1:2)), and 세로(end) = movstd (가로(end-1:end)).

"discard"

Any 세로 values that use a window extending beyond the original data array are deleted. For example, with a 10-element data vector and a window of length 3, the output will contain only 8 elements. The first element would require calculating the function over indices [0, 1, 2] and is therefore discarded. The last element would require calculating the function over indices [9, 10, 11] and is therefore discarded.

"fill"

Any window elements outside the data array are replaced by NaN. For example, with a window of length 3, 세로(1) = movstd ([NaN, 가로(1:2)]), and 세로(end) = movstd ([가로(end-1:end), NaN]). This option usually results in 세로 having NaN values at the boundaries, although it is influenced by how movstd handles NaN, and also by the property "nancond".

user_value

Any window elements outside the data array are replaced by the specified value user_value which must be a numeric scalar. For example, with a window of length 3, 세로(1) = movstd ([user_value, 가로(1:2)]), and 세로(end) = movstd ([가로(end-1:end), user_value]). A common choice for user_value is 0.

"same"

Any window elements outside the data array are replaced by the value of 가로 at the boundary. For example, with a window of length 3, 세로(1) = movstd ([가로(1), 가로(1:2)]), and 세로(end) = movstd ([가로(end-1:end), 가로(end)]).

"periodic"

The window is wrapped so that any missing data elements are taken from the other side of the data. For example, with a window of length 3, 세로(1) = movstd ([가로(end), 가로(1:2)]), and 세로(end) = movstd ([가로(end-1:end), 가로(1)]).

"SamplePoints"

Caution: This option is not yet implemented.

Programming Note: This function is a wrapper which calls movfun. For additional options and documentation, See movfun.

같이 보기: movfun, movslice, movmad, movmax, movmean, movmedian, movmin, movprod, movsum, movvar.

세로 = movsum (가로, wlen)
세로 = movsum (가로, [na, nb])
세로 = movsum (…, dim)
세로 = movsum (…, "nancond")
세로 = movsum (…, property, )

Calculate the moving sum over a sliding window of length wlen on data 가로.

If wlen is a scalar, the function movsum is applied to a moving window of length wlen. When wlen is an odd number the window is symmetric and includes (wlen - 1) / 2 elements on either side of the central element. For example, when calculating the output at index 5 with a window length of 3, movsum uses data elements [4, 5, 6]. If wlen is an even number, the window is asymmetric and has wlen/2 elements to the left of the central element and wlen/2 - 1 elements to the right of the central element. For example, when calculating the output at index 5 with a window length of 4, movsum uses data elements [3, 4, 5, 6].

If wlen is an array with two elements [nbna], the function is applied to a moving window -nb:na. This window includes nb number of elements before the current element and na number of elements after the current element. The current element is always included. For example, given wlen = [3, 0], the data used to calculate index 5 is [2, 3, 4, 5].

If the optional argument dim is given, operate along this dimension.

The optional string argument "nancond" controls whether NaN and NA values should be included ("includenan"), or excluded ("omitnan"), from the data passed to movsum. The default is "includenan". Caution: the "omitnan" option is not yet implemented.

The calculation can be controlled by specifying property/ pairs. Valid properties are

"Endpoints"

This property controls how results are calculated at the boundaries (endpoints) of the window. Possible values are:

"shrink" (default)

The window is truncated at the beginning and end of the array to exclude elements for which there is no source data. For example, with a window of length 3, 세로(1) = movsum (가로(1:2)), and 세로(end) = movsum (가로(end-1:end)).

"discard"

Any 세로 values that use a window extending beyond the original data array are deleted. For example, with a 10-element data vector and a window of length 3, the output will contain only 8 elements. The first element would require calculating the function over indices [0, 1, 2] and is therefore discarded. The last element would require calculating the function over indices [9, 10, 11] and is therefore discarded.

"fill"

Any window elements outside the data array are replaced by NaN. For example, with a window of length 3, 세로(1) = movsum ([NaN, 가로(1:2)]), and 세로(end) = movsum ([가로(end-1:end), NaN]). This option usually results in 세로 having NaN values at the boundaries, although it is influenced by how movsum handles NaN, and also by the property "nancond".

user_value

Any window elements outside the data array are replaced by the specified value user_value which must be a numeric scalar. For example, with a window of length 3, 세로(1) = movsum ([user_value, 가로(1:2)]), and 세로(end) = movsum ([가로(end-1:end), user_value]). A common choice for user_value is 0.

"same"

Any window elements outside the data array are replaced by the value of 가로 at the boundary. For example, with a window of length 3, 세로(1) = movsum ([가로(1), 가로(1:2)]), and 세로(end) = movsum ([가로(end-1:end), 가로(end)]).

"periodic"

The window is wrapped so that any missing data elements are taken from the other side of the data. For example, with a window of length 3, 세로(1) = movsum ([가로(end), 가로(1:2)]), and 세로(end) = movsum ([가로(end-1:end), 가로(1)]).

"SamplePoints"

Caution: This option is not yet implemented.

Programming Note: This function is a wrapper which calls movfun. For additional options and documentation, See movfun.

같이 보기: movfun, movslice, movmad, movmax, movmean, movmedian, movmin, movprod, movstd, movvar.

세로 = movvar (가로, wlen)
세로 = movvar (가로, [na, nb])
세로 = movvar (…, dim)
세로 = movvar (…, "nancond")
세로 = movvar (…, property, )

Calculate the moving variance over a sliding window of length wlen on data 가로.

If wlen is a scalar, the function var is applied to a moving window of length wlen. When wlen is an odd number the window is symmetric and includes (wlen - 1) / 2 elements on either side of the central element. For example, when calculating the output at index 5 with a window length of 3, movvar uses data elements [4, 5, 6]. If wlen is an even number, the window is asymmetric and has wlen/2 elements to the left of the central element and wlen/2 - 1 elements to the right of the central element. For example, when calculating the output at index 5 with a window length of 4, movvar uses data elements [3, 4, 5, 6].

If wlen is an array with two elements [nbna], the function is applied to a moving window -nb:na. This window includes nb number of elements before the current element and na number of elements after the current element. The current element is always included. For example, given wlen = [3, 0], the data used to calculate index 5 is [2, 3, 4, 5].

If the optional argument dim is given, operate along this dimension.

The optional string argument "nancond" controls whether NaN and NA values should be included ("includenan"), or excluded ("omitnan"), from the data passed to var. The default is "includenan". Caution: the "omitnan" option is not yet implemented.

The calculation can be controlled by specifying property/ pairs. Valid properties are

"Endpoints"

This property controls how results are calculated at the boundaries (endpoints) of the window. Possible values are:

"shrink" (default)

The window is truncated at the beginning and end of the array to exclude elements for which there is no source data. For example, with a window of length 3, 세로(1) = var (가로(1:2)), and 세로(end) = var (가로(end-1:end)).

"discard"

Any 세로 values that use a window extending beyond the original data array are deleted. For example, with a 10-element data vector and a window of length 3, the output will contain only 8 elements. The first element would require calculating the function over indices [0, 1, 2] and is therefore discarded. The last element would require calculating the function over indices [9, 10, 11] and is therefore discarded.

"fill"

Any window elements outside the data array are replaced by NaN. For example, with a window of length 3, 세로(1) = var ([NaN, 가로(1:2)]), and 세로(end) = var ([가로(end-1:end), NaN]). This option usually results in 세로 having NaN values at the boundaries, although it is influenced by how var handles NaN, and also by the property "nancond".

user_value

Any window elements outside the data array are replaced by the specified value user_value which must be a numeric scalar. For example, with a window of length 3, 세로(1) = var ([user_value, 가로(1:2)]), and 세로(end) = var ([가로(end-1:end), user_value]). A common choice for user_value is 0.

"same"

Any window elements outside the data array are replaced by the value of 가로 at the boundary. For example, with a window of length 3, 세로(1) = var ([가로(1), 가로(1:2)]), and 세로(end) = var ([가로(end-1:end), 가로(end)]).

"periodic"

The window is wrapped so that any missing data elements are taken from the other side of the data. For example, with a window of length 3, 세로(1) = var ([가로(end), 가로(1:2)]), and 세로(end) = var ([가로(end-1:end), 가로(1)]).

"SamplePoints"

Caution: This option is not yet implemented.

Programming Note: This function is a wrapper which calls movfun. For additional options and documentation, See movfun.

같이 보기: movfun, movslice, movmad, movmax, movmean, movmedian, movmin, movprod, movstd, movsum.


다음: , 이전: , 상위 문서: Statistics   [차례][찾아보기]