I have an array of points, each point consists of a x and y, the x is a timestamp, y is the actual data.
I have created a time series plot in Javascript and I would like to curve fit the data and draw the curve.
Can anyone help me to achieve this?
My list of points:
{fltX: 0, fltY: 55.932203389830505}
{fltX: 1.8237082066869301, fltY: 55.932203389830505}
{fltX: 3.6474164133738602, fltY: 55.932203389830505}
{fltX: 5.47112462006079, fltY: 55.932203389830505}
{fltX: 7.2948328267477205, fltY: 81.35593220338983}
The X co-ordinates have already been scaled to the X axis. I'm not looking for someone to write the code for me, however a good tutorial or guide would be very much appreciated.
You may be interested in genetic-js. To quote from the project page:
From a plot of vertices, this genetic algorithm optimizes a continious function to best fit the data (aka least squared error). Genetic.js automatically runs the algorithm in the background with web workers so that the UI experience isn't compromised.
An elaborate example is available here.