The latest version for DAS is WSO2 Data Analytics Server 3.1.0. View documentation for the latest release.
WSO2 Data Analytics Server is succeeded by WSO2 Stream Processor. To view the latest documentation for WSO2 SP, see WSO2 Stream Processor Documentation.

All docs This doc
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
||
Skip to end of metadata
Go to start of metadata

The kalmanMinMax function uses the kalman filter to smooth the time series values in the given window size, and then determine the maxima and minima of that set of values.

Input parameters 

ParameterRequired/OptionalDescription
VariableRequiredThe time series value to be considered for minima maxima detection.
QRequiredThe standard deviation of the process noise.

R

RequiredThe standard deviation of the measurement noise.

Window Size

RequiredThe number of values to be considered for smoothing and determining the extremes.
Extrema TypeRequiredThis can be minmax or minmax.

Output parameters

ParameterNameDescription
min or max value The variable name specified in the input parameter.The value of the min or max point.
extrema Typeextrema TypeIndicates whether the returned value is a min value or a max value.

Examples

Minimum values

The following returns the maximum values for a set of price values.

from inputStream#timeseries:kalmanMinMax(price, 0.000001,0.0001, 25, 'min')
select *
insert into outputStream;

 

Maximum values

The following returns the minimum values for a set of price values.

from inputStream#timeseries:kalmanMinMax(price, 0.000001,0.0001, 25, max)
select *
insert into outputStream;
Minimum and maximum values

The following returns both the minimum values and the maximum values for a set of price values.

from inputStream#timeseries:kalmanMinMax(price, 0.000001,0.0001, 25, 'minmax')
select *
insert into outputStream;
  • No labels