Statistics
LinearFilter
apply linear filter to a data set
Calling Sequence
Parameters
Description
Options
Examples
LinearFilter(X, Y, options)
X
-
data set
Y
filter
options
(optional) equation(s) of the form option=value where option is one of ignore or initial; specify options for the LinearFilter function
The LinearFilter function applies linear filter to a set of observations. By default, convolution method is used:
`X'`[i] = Sum(X[i+1-j]*Y[j], j = 1..m);
X'i=∑j=1m⁡Xi+1−j⁢Yj
where m is the size of the filter. For i<m the set of initial values will be used. By default, X is padded on the left with m−1 zeros. Option initial can be used to specify the initial values.
Recursive filter is defined as follows:
`X'`[i] = X[i]*Y[1]+Sum(`X'`[i+1-j]*Y[j], j = 2..m);
X'i=Xi⁢Y1+∑j=2m⁡X'i+1−j⁢Yj
The first parameter X is a single data sample - given as e.g. a Vector. Each value represents an individual observation.
The second parameter Y is the filter - given as e.g. a Vector. Each value represents a filter coefficient.
The options argument can contain one or more of the options shown below.
ignore=truefalse -- This option is used to specify how to handle non-numeric data. If ignore is set to true all non-numeric items in X will be ignored. Missing values are allowed in the data set but not in the filter.
initial=deduce, or Vector -- This option specifies the initial values in reverse order. The default is a set of m−1 zeros.
recursive=truefalse -- If this option is set to true then recursive filter will be used.
with⁡Statistics:
A≔seq⁡sin⁡i,i=1..9,undefined:
LinearFilter⁡A,1.,0.3,0.2
0.8414709848078971.161738722268050.582203433069151−0.532607007524832−1.15774102164354−0.7184532796594530.3813770943264841.130571126599230.840323278972529Float⁡undefined
LinearFilter⁡A,1.,0.3,0.2,ignore
0.8414709848078971.161738722268050.582203433069151−0.532607007524832−1.15774102164354−0.7184532796594530.3813770943264841.130571126599230.840323278972529
LinearFilter⁡A,1.,0.3,0.2,ignore,initial=3,2,1
2.141470984807901.761738722268050.582203433069151−0.532607007524832−1.15774102164354−0.7184532796594530.3813770943264841.130571126599230.840323278972529
LinearFilter⁡A,1.,0.3,0.2,ignore,recursive
0.8414709848078971.161738722268050.657935821701862−0.327074004343760−0.925459311625894−0.6224680925554460.2851543086269760.9504109207003850.754272623177268
See Also
Statistics[DataSmoothing]
Statistics[ExponentialSmoothing]
Download Help Document