I need to approximate a table-specific 2D function similar to the one
x0 y0 x1 y1 ... xn yn
for each point I have a "weight" (standard error for this measure). I need to write a function like this:
typedef std::vector< double > DVector; void approximate2D( const DVector & x , const DVector & y , const DVector & weights , double newMeasuredX , double newMeasuredY , double newMeasuredWeight , double & outApproximatedX , double & outApproximatedY );
to get one value (outApproximatedX; outApproximatedY) depends on the previous values ββand the new measured value.
RMS error (RMS) should be used as follows: if the RMS error is minimal, then the desired function should approach this point, if the RMS error is maximum, then this point should be used with a minimal contribution.
The approximation should be linear (I think), since I know that the desired function is a straight line.
Googled about half a day and did not find any offers.
Thanks.
source share