Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The kernalMinMax function uses Gaussian Kernel 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.
bandwidthRequiredThe bandwidth of the Gaussian Kernel calculation.
window sizeRequiredThe number of values to be considered for smoothing and determining the extremes.
Extrema typeRequiredThis can be min, max or minmax.

Output parameters

ParameterNameDescription
min or max valueThe variable name specified in the input parameter.The value of the min or max point.
extremaTypeextrema 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.

Code Block
languagesql
from inputStream#timeseries:kernelMinMax(price, 3, 7, ‘min’)
select *
insert into outputStream;

 

Maximum values

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

Code Block
languagesql
from inputStream#timeseries:kernelMinMax(price, 3, 7, '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.

Code Block
languagesql
from inputStream#timeseries:kernelMinMax(price, 3, 7, ‘minmax’)
select *
insert into outputStream;