[SciPy-dev] include fit functions such as erf, exp, cosine etc.

Charles Harris charles.harris at sdl.usu.edu
Sat Oct 22 01:11:41 EDT 2005




> -----Original Message-----
> From: scipy-dev-bounces at scipy.net on behalf of Robert Kern
> Sent: Fri 10/21/2005 10:56 PM
> To: SciPy Developers List
> Subject: Re: [SciPy-dev] include fit functions such as erf, exp, cosine etc.
> 
>Matt Fishburn wrote:
>> Hello,
>> 
>> I recently needed to fit some data to an erf function, but I couldn't 
>> seem to find one in scipy (I ended up coding one using the outline on 
>> page 16 of the tutorial).  Are there any functions to fit data to common 
>> functions such as erf, exp, cosine, and arbitrary degree polynomials, or 
>> support to include such functions in the future?
>
> It might be good to write something that assists fitting polynomials,
> but otherwise, there's not much point.

My own preference here is to do a least squares fit with Chebychev polynomials as

1) The series is better conditioned with regard to coefficient errors.
2) The fitting matrix tends to be better conditioned.
3) Tends to yield a L_inf fit when a high degree series is truncated.
4) Is a plain old least squares polynomial fit when all the terms are used.
5) High degree polynomials are ill conditioned anyway.
6) For low degree fits the Chebychev series can be converted to a polynomial.
7) Reverse recursion makes the series easy to evaluate.

My $.02 .

Chuck


-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter

_______________________________________________
Scipy-dev mailing list
Scipy-dev at scipy.net
http://www.scipy.net/mailman/listinfo/scipy-dev

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3436 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20051021/d4944f13/attachment.bin>


More information about the SciPy-Dev mailing list