Re: fonction in python
- From: Duncan Smith <buzzard@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 04 Jul 2006 23:44:53 +0100
Steven D'Aprano wrote:
On Tue, 04 Jul 2006 03:06:37 -0700, aliassaf wrote:
Hello,
If we write = x^2 and if I give to the program the values of x, it will
going to calculate the values of y, and also for x.
But it is possible ? that is if I give to the program the values of X and Y,
it will indicate to me the relation between the two variables, in the other
hand if I look to the program x=2 y=4, x=3 y=9 ect... it is going to show me
that f (t)!!!
You are asking for curve-fitting. There is a HUGE amount of work on
curve-fitting in computer science and statistics.
Generally, you start with some data points (x, y). You generally have some
idea of what sort of function you expect -- is it a straight line? A
curve? What sort of curve? A polynomial, an exponential, a sine curve, a
cubic spline, a Bezier curve?
You might like to google on "least squares curve fitting" and "linear
regression". That's just two methods out of many.
Some curve-fitting methods also estimate the error between the predicted
curve and the data points; you could then try all of the methods and pick
the one with the least error.
The problem being that complex enough models will fit the data
arbitrarily closely (i.e. over-fit). The OP should take into account
any prior expectations over the type of function (as you indicate) and
apply Occam's razor (find a relatively simple model that gives a
reasonable fit to the data).
Duncan
.
- References:
- fonction in python
- From: aliassaf
- Re: fonction in python
- From: Steven D'Aprano
- fonction in python
- Prev by Date: Re: Can anyone please analyse this program for me (write a pseudocode for it).
- Next by Date: Re: For a fast implementation of Python
- Previous by thread: Re: fonction in python
- Next by thread: Re: fonction in python
- Index(es):
Relevant Pages
|