Task: I have a table with n rows and m columns, containing data points at different time stamps. For each row, I want to find two parameters k and c, which define a function that approximates the m points. To do so, I have an optimization, minimizing the mean squared error.
The issue is that for the row i+1, I need to use the k and c calculated with the data points of row i, as starting point for my i+1 optimization.
How should I set up my loop in such a way that I use one row at a time but I update the initial values of k and c at every iteration?
Do I need a chunk loop to iterate on every row and a recursive loop inside it?
In your recursive loop, you keep “chopping off” the top row for processing.
Your recursive loop start has two ports for initialisation and accordingly you have to recursion ports at the Loop end.
You pass in the “bottom” port of the Row Splitter to one of them and the “optimized” k, c table to the other.
In this example I collect the processed top row as well as the optimized k,c values in a collector port (thats why you have for ports at loop end).
Depending on your set up you may want to determine the end of loop with a variable, but that depends on how many rows of data you processes and how variable that amount is.