English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2007-05-10 06:42:55 · 3 answers · asked by nabarun 1 in Science & Mathematics Mathematics

3 answers

We want to fit a set of N (x, y) data points to a polynomial of form
y = a0 + a1x + ... + anx^n
where generally n is much smaller than N, and always n <= N.

This is normally done via least-squares fitting: we want to minimise
Σ(i=1 to N) (yi - a0 - a1xi - ... - an xi^n)^2
with respect to the variables a0, a1, ..., an.
The partial derivative of this with respect to aj is
Σ(i=1 to N) 2(yi - a0 - a1xi - ... - an xi^n)(-xi^j)
which is equal to 0 when
a0(Σxi^j) + a1(Σxi^(j+1)) + ... + an(Σxi^(j+n)) = Σyi.xi^j
where all the sums are for i = 1 to N.
So, for each value of j we get an equation in a0, ..., an. We solve these simultaneously (usually via matrix manipulation) to find the values.

So the algorithm is:
As you read the data points, maintain the following totals:
N (= Σ1)
Σxi
Σxi^2
...
Σxi^2n
Σyi
Σyi.xi
Σyi.xi^2
...
Σyi.xi^n

Then form an augmented matrix
[Σ1 Σxi ... Σxi^n | Σyi]
[Σxi Σxi^2 ... Σxi^(n+1) | Σyi.xi]
...
[Σxi^n Σxi^(n+1) ... Σxi^2n | Σyi.xi^n]

and solve.

2007-05-10 16:13:21 · answer #1 · answered by Scarlet Manuka 7 · 0 0

You need to provide more details for an answer.
(a) Are you using a calculator or computer? If the former, which? If the latter, what software?
(b) Are you trying to fit data to a simple power model (y = a*x^n), or are you going for the full blown multi-term polynomial?
(c) What is the approx. number of data points here? Five? A hundred? A hundred thousand? What is the scale of the problem?
(d) Are we trying to fit n data points to an nth degree polynomial (a very easy algorithm), or does the number of data points far exceed any useful degree of the polynomial?
(e) Context! What is the course? What is more paramount, efficiency or precision?

I probably could help if I knew more of this information.

2007-05-10 15:56:23 · answer #2 · answered by athenianmike 2 · 0 0

i think of that's a multi-faceted floor which contain a pretzel or knot. you're able to desire to examine dissimilar surfaces to descibe the products contained thereon. try asking in amthematics. it would in all threat get a miles better answer there from somebody who knows the mathematics in touch.

2016-12-17 09:16:01 · answer #3 · answered by Erika 4 · 0 0

fedest.com, questions and answers