Polynomial approximation of a function

21 views
Skip to first unread message

Nathann Cohen

unread,
Nov 2, 2009, 11:41:07 AM11/2/09
to Sage Support
Hello !!!

I remember there is an easy way ( through matrices ) to get the "best" approximation of a function by a polynomial of bounded degree ( and not only the usual approximation by a line ).... I looked for such functions in Sage, but found none... Does it mean there is not already in Sage some function to compute it ( it would be a shame !!! ), or just that I once more failed to look for a functio properly ( and that would be a shame, too.... )     :-)

Thank you for your help !!!

Nathann

Laurent

unread,
Nov 2, 2009, 11:50:01 AM11/2/09
to sage-s...@googlegroups.com
Nathalie Cohen ha scritto:

> Hello !!!
>
> I remember there is an easy way ( through matrices ) to get the "best"
> approximation of a function by a polynomial of bounded degree ( and not only
> the usual approximation by a line )....
Are you speaking about the Taylor expansion ?
If so, it is implemented in Sage, but I don't remember the exact names.
(searching for "Taylor" in the documentation)

have a good afternoon
Laurent

Robert Bradshaw

unread,
Nov 2, 2009, 12:18:43 PM11/2/09
to sage-s...@googlegroups.com

Are you thinking of Chebyshev polynomials? I don't think there is, but
there might be as part of scipy. I've got (two) implementations of
them that I haven't had time to put into Sage proper, but they're
pretty straightforward to implement.

- Robert

Jason Grout

unread,
Nov 2, 2009, 1:15:35 PM11/2/09
to sage-s...@googlegroups.com

Sage also includes mpmath, which appears to have appropriate functions:

http://mpmath.googlecode.com/svn/trunk/doc/build/calculus/approximation.html

Jason

Nathann Cohen

unread,
Nov 2, 2009, 5:31:07 PM11/2/09
to sage-support
Thank you for your answers !!

I was thinking about some multidimensional linear approximation, where
the basis you use is ( for points of coordinates (x_i, y_i ) ) the
vectors
The family of x_i, x_i
The family of x_i, x_i^2
The family of x_i, x_i^3
The family of x_i, x_i^4
...

But it turns out Scipy was the asnwer.... Thank you very much :-)

Nathann
> http://mpmath.googlecode.com/svn/trunk/doc/build/calculus/approximati...
>
> Jason
Reply all
Reply to author
Forward
0 new messages