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
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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.