Write an equation based on data

  • Context: Undergrad 
  • Thread starter Thread starter musicgold
  • Start date Start date
  • Tags Tags
    Data
Click For Summary

Discussion Overview

The discussion revolves around finding a mathematical function that best fits a given set of data points. Participants explore various methods for interpolation and function fitting, including polynomial fitting and graphical analysis.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant seeks guidance on determining which function describes the provided data points, questioning whether a systematic process exists or if guessing is necessary.
  • Another suggests using Excel to graph the data and observe the resulting trends.
  • A participant notes that there are infinitely many functions that can fit the points and presents the Lagrange polynomial as a unique fifth-degree polynomial solution.
  • Another participant introduces Newton's forward difference interpolation, highlighting its effectiveness for data from an arithmetic series, while contrasting it with Lagrange's method, which is less limited.
  • One participant mentions that the last five data points could fit a specific function, y = (2^(2-x)), and suggests considering a piecewise function as an option.
  • Another participant reiterates the utility of Excel for polynomial fitting and emphasizes the effectiveness of the Lagrange polynomial method shared earlier.

Areas of Agreement / Disagreement

Participants express a range of methods for fitting functions to data, with no consensus on a single best approach. There are competing views on the effectiveness of different interpolation methods and the suitability of polynomial fitting.

Contextual Notes

Some methods discussed, such as Newton's forward difference interpolation, have limitations regarding the uniformity of data spacing. The discussion also reflects varying levels of familiarity with mathematical concepts and tools among participants.

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.
 
Physics 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:
[tex]-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)}[/tex]
 
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
 

Similar threads

  • · Replies 23 ·
Replies
23
Views
4K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 19 ·
Replies
19
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
4K