Write an equation based on data

  • Thread starter Thread starter musicgold
  • Start date Start date
  • Tags Tags
    Data
AI Thread Summary
To determine the best function that describes a given set of data points, various methods can be employed, with the Lagrange polynomial being a notable option. This method provides a unique polynomial that fits all specified points, even when they do not follow a simple pattern. While Excel can be used for graphical representation and polynomial fitting, it is crucial to select a polynomial of an appropriate degree for accurate results. Additionally, alternative methods like Newton's forward difference interpolation can be effective but have limitations regarding data point consistency. Ultimately, using the Lagrange polynomial method is recommended for its flexibility and ease of use.
musicgold
Messages
303
Reaction score
19
Hi,

I am trying to understand what is the best way to solve problems like the one below. I have a few data points and I need to which function best describes that data.

(x, y) = (-3, -32) (-2, 16) (-1, 8) (0,4) (1,2) (2, 1)

note that the y parameter in the first data point is -32 and not 32.Is there a process to solve such problems or do I have to guess the function?

Thanks.
 
Mathematics news on Phys.org
put it on a graph and see what you get using excel
 
There are, of course, an infinite number of functions whose graphs go through those points. The unique fifth degree polynomial that fits is the Lagrange polynomial:
-32\frac{(x+ 2)(x+ 1)(x)(x- 1)(x- 2)}{(-3+2)(-3+ 1)(-3)(-3- 1)(-3-2)}+ 16\frac{(x+ 3)(x+ 1)(x)(x- 1)(x- 2)}{(-2+3)(-2+ 1)(-2)(-2- 1)(-2-2)}+ 8\frac{(x+ 3)(x+ 2)(x)(x- 1)(x- 2)}{(-1+3)(-1+ 2)(-3)(-1-1)(-1-2)}+ 4\frac{(x+ 3)(x+ 2)(x+1)(x- 1)(x- 2)}{(0+3)(0+2)(-0+ 1)(0- 1)(0-2)}+ 2\frac{(x+3)(x+ 2)(x+ 1)(x)(x- 2)}{(1+ 3)(1+2)(1+ 1)(1)(1-2)}+ \frac{(x+ 3)(x+ 2)(x+ 1)(x)(x- 1)}{(1+ 3)(1+2)(-3+ 1)(-3)(-3-2)}
 
There are several methods for example Newton's forward difference interpolation which though quite difficult to do and limited in the fact that you have to have a constant difference between the terms it is very effective, because if the data points are from an arithmetic series it will give you an expression of the series. Above is an example of Lagrange's method which is far easier to do, less limited as the data points can be anything and returns a polynomial that works.
 
1. As you've emphasized that the first data is in fact not an error it may not be helpful to point out that the last five data points are in the function: y = (2^(2-x)) , but if a piecewise function is an option than it's worth a thought.
2. Otherwise you can use excel as Woopydalan said. However adding a linear trend line will do you no good. If I remember correctly there is an option for fitting a polynomial of higher degrees. It may go up to a sixth degree polynomial.
3. The Lagrange polynomial method that HallsofIvy posted will definitely work...so actually forget what I said and just copy and paste that into wolfram alpha
 
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Back
Top