Operator RLSFilter

Primitive operator image not displayed. Problem loading file: ../../image/tk$com.ibm.streams.timeseries/op$com.ibm.streams.timeseries.modeling$RLSFilter.svg

The Recursive Least Squares (RLS) is linear regression estimation algorithm that learns to predict a target time series, given inputs.

A linear regression model is estimated from a sequence of provided inputs(covariates) and targets (dependent variables). The fitting is done adaptively by using the recursive least squares (RLS) method. The fitted model can be used to estimate the target (dependent variable), given new unseen inputs (covariates).

The RLSFilter operator takes input in the form of a list of values and produces output in the form of single value or list of values.

Behavior in a consistent region

  • The RLSFilter operator is not supported in a consistent region. A warning occurs when you compile your streams processing application.
  • The operator cannot be the start of a consistent region. An error occurs when you compile your streams processing application.

Summary

Ports
This operator has 2 input ports and 3 output ports.
Windowing
This operator does not accept any windowing configurations.
Parameters
This operator supports arbitrary parameters in addition to 3 specific parameters.

Required: dependentVariable, forgettingFactor, inputCovariates

Metrics
This operator does not report any metrics.

Properties

Implementation
C++
Threading
Never - Operator never provides a single threaded execution context.

Input Ports

Ports (0)

This port ingests tuples to update the model.

Properties

Ports (1)

This port ingests tuples to be scored.

Properties

Output Ports

Assignments
This operator allows any SPL expression of the correct type to be assigned to output attributes.
Output Functions
RLSDep
<any T> T AsIs(T v)

<any T> T estimatedValue()

RLSCoef
<any T> T AsIs(T v)

<any T> list<T> coefficients()

Ports (0)

Properties

Ports (1)

Properties

Ports (2)

Properties

Parameters

This operator supports arbitrary parameters in addition to 3 specific parameters.

Required: dependentVariable, forgettingFactor, inputCovariates

dependentVariable

Specifies the input attribute that contains the dependent variable from the update input port.

Properties

forgettingFactor

Specifies that the forgettingFactor range is between 0 and 1.

Properties

inputCovariates

Specifies the input attribute that contains the co-variates to be operated upon from both the update port and scoring port.

Properties

Code Templates

RecursiveLeastSquare

(
stream<${schema1}> ${outputStream1};
stream<${schema2}> ${outputStream2};
stream<${schema3}> ${outputStream3})
	 	= RLSFilter(${inputStreamForUpdate};${inputStreamForScoring}
)
	{
		param
			inputCovariates: 		${inputCovariatesExpression};
			dependentVariable:  	${dependentVariableExpression};			
			forgettingFactor:  			${forgettingFactorConstant};
		output
			${outputStream(n)}: 	${outputExpression};
			
	}		
      

Libraries

RecursiveLeastSquares
Library Name: modeling
Library Path: ../../../impl/lib/
Include Path: ../../../impl/include/