Jump to content

polynomial fit (solved)


qwanta

Recommended Posts

I was looking for a php library to do a polynomial fit to a set of data. I ended up finding a great package at phpmath.com and thought I would post a link here as I had a hard time finding it (and this forum doesn't have any references to it AFAIK).

 

The link to the polyfit function:

http://www.phpmath.com/home?op=perm&nid=47

 

It requires the php implementation of the JAMA matrix library ("Java Matrix Package") which can be downloaded here:

http://www.phpmath.com/build03/JAMA/docs/

http://www.phpmath.com/build03/JAMA/docs/download.php

 

 

There is some other good stuff on the site. For example, I discovered the PHPExcelProject:

http://www.phpmath.com/home?op=perm&nid=112

http://www.codeplex.com/PHPExcel

 

This is a php implementation of many excel functions. A polynomial fit could be done with the LINEST function.

 

Link to comment
https://forums.phpfreaks.com/topic/161517-polynomial-fit-solved/
Share on other sites

There is some other good stuff on the site. For example, I discovered the PHPExcelProject:

http://www.phpmath.com/home?op=perm&nid=112

http://www.codeplex.com/PHPExcel

 

This is a php implementation of many excel functions. A polynomial fit could be done with the LINEST function.

PHPExcel actually uses a modified version of the PHP JAMA port (currently being updated to PHP5 as part of an overall reworking of the formula parser and function library), and some code routines from within the polyfit library at phpmath.com (used with permission, of course)

 

A set of best fit routines is defined in the trendClass (/Classes/PHPExcel/Shared/trend) within PHPExcel, giving Linear, Logarithmic, Exponential, Power, and 2nd to 6th order polynomials. This is the underlying code used by the LINEST and LOGEST PHPExcel functions, though it doesn't yet work with negative values in data ranges for the Logarithmic, Exponential and Power regressions.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.