Icon

20230411 Pikairos Weighted Moving Average

This workflow shows how to implement from scracth a simple Weighted Moving Average.
The size of the Weighted Moving Average is determined by the numbers of Weights in Vector stored as rows in a table.

This workflow brings a possible solution to question asked in the KNIME forum by BhuvaneswariS in post number 65213.

1000 rowssin( x)CreateLag Columnsbased onWeighting Vector SizeSetMissing Values = 0Loop overLagged Columnsto weight themby their correspondingWeight in VectorDummyWeighting VectorSelect Weightfor Current ColumnCreate a Columnto AssociateRow Indexto every WeightCreate a Variablewith CurrentColumn WeightMultiply CurrentLag Column byits Corresponding WeightColumn AppendWeightedLagged ColumnsKeep onlyNumeric Columns forMoving Weighted AverageCalculationAggregate bya SUM operatorall the WeightedLagged ColumnsJoin Initial Tableto CalculatedWeightedMoving Average Lag based onWeighting Vector SizeOriginal Signal& Filtered Signalusing a WeightedMoving Averaged FilterInitial Time SeriesCreate Date&TimeRange Math Formula Lag Column Missing Value Column ListLoop Start Table Creator Rule-basedRow Filter Math Formula Table Rowto Variable Math Formula ExtractColumn Header Loop End (ColumnAppend) Column Splitter Column Aggregator Joiner Extract TableDimension Math Formula(Variable) Line Plot Line Plot 1000 rowssin( x)CreateLag Columnsbased onWeighting Vector SizeSetMissing Values = 0Loop overLagged Columnsto weight themby their correspondingWeight in VectorDummyWeighting VectorSelect Weightfor Current ColumnCreate a Columnto AssociateRow Indexto every WeightCreate a Variablewith CurrentColumn WeightMultiply CurrentLag Column byits Corresponding WeightColumn AppendWeightedLagged ColumnsKeep onlyNumeric Columns forMoving Weighted AverageCalculationAggregate bya SUM operatorall the WeightedLagged ColumnsJoin Initial Tableto CalculatedWeightedMoving Average Lag based onWeighting Vector SizeOriginal Signal& Filtered Signalusing a WeightedMoving Averaged FilterInitial Time SeriesCreate Date&TimeRange Math Formula Lag Column Missing Value Column ListLoop Start Table Creator Rule-basedRow Filter Math Formula Table Rowto Variable Math Formula ExtractColumn Header Loop End (ColumnAppend) Column Splitter Column Aggregator Joiner Extract TableDimension Math Formula(Variable) Line Plot Line Plot

Nodes

Extensions

Links