I want to estimate continuation parts of a curve by obtaining points online by using particle filter. For example in t=0 (time is zero) i have 5 points (p1,p2,p3,p4,p5). So, in t=0 i can estimate a curve by for example polyfit(p1,p2,p3,p4,p5). In t=1 i receive 3 new points (p6,p7,p8) and now i must estimate a better and accurate curve by using these 3 new points. One way is polyfit(p1,p2,p3,p4,p5,p6,p7,p8) but because of time saving in my program, i can not use that. Because polyfit consider all points from the first and i don't want to consider all points from the first (i have so many points and i want to write a code in C language). i want the available curve to be better and more accurate by using only two new points (p5, p6) online. In this way i think "particle filter" technique can be a suitable way to do that. lets me to give an example:
in t=0 i have these 5 points:
t=0: p1=(1,2) p2=(2,5.5) p3=(3,12.5) p4=(4,20) p5=(5,31) now i must estimate a curve for above points. for example i must find the coefficients of a polynomial p(x) of degree 2 (for example n=2 so i must estimate a,b,c).
in t=1 i receive 3 new points and now i must update the curve and make it more accurate without using 5 previous points (because of time saving)by using particle filter.
t=1: p6=(6,40) p7=(7,55) p8=(8,72) and p(x).
now i must update a,b,c and make them better and more accurate.
I am studying particle filter technique recently and i don't know what i must do and how i can write its code. please help me in this way. thanks a lot