Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- data fitting with php
September 6, 2007, 3:01 pm
rate this thread
I have an array containing n numbers and want to fit them to e.g. a
polynomial function f(x), x=1...n.
Is there a php script / library for doing that?
I basically wish to do curve fitting to my data array, directly in
Ideal would be something like polyfit in MatLab.
One possibility would be to involve a c++ program doing the data
fitting. Export the array as a dump file from php, execute the
compiled c++ polynomial fitting file program calling the dump file and
saving the result, and then open the result file in php. Thats of
course not so elegant ...
Thanks for any help.
Re: data fitting with php
I meant with f(x) a polynomial of any order g.
I have done it now with an external c++.
Here's the current result:
with order g=5.
Would be good to include other fitting methods like spline,
Do libraries exist for that in php? Or c++ ...?