I have a set of noisy experimental data which effectively describes the gradient of a function which passes through two known specific x,y endpoint coordinates.
I can fit a polynomial to the gradient data to give me
and then integrate it to give me
a polynomial which descibes the function fairly well. Of course there is a constant of integration which I can set so that the function passes as close as possible to the known end points.
My problem is that because of noise and possible some progressive error in the experimental data there is some residual "slope" in the function such that it passes above one end point and below the other. I really want it to go exactly through them.
I can modify the first order polynomial coefficient to improve it, but cannot get it exact enough presumably because of contributions from higher order coefficients. Iterating on this can help but I am not certain it will converge or indeed whether it is the "right" thing to do.
So, my question is, is there a way of deterministly modifying a polynomial function to pass through two specific points?
Thanks in advance for any help anyone can offer.