Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Incoherent
 
Posts: n/a
Default using linest to generate 3rd order polynomial coefficients

In Excel 2000 (and earlier), this example.
A B C D
1 1 1^2 1^3 2.3
2 2 2^2 2^3 4.2
3 3 3^2 3^3 4.7
4 4 4^2 4^3 5.1
5 . . . and so on

=INDEX(LINEST(D1:D5,A1:C5),1) gives the first coefficient for a 3rd order
polynomial fit to the data in column D.
=INDEX(LINEST(D1:D5,A1:C5),2) gives the 2nd,
=INDEX(LINEST(D1:D5,A1:C5),3) the 3rd
=INDEX(LINEST(D1:D5,A1:C5),4) gives the 4th. In the form ax^3+bx^2+cx+d, I
can find the fit for the data. The above formulas give me a,b,c and d.
(This can also be used as a single array formula, dropping the "INDEX" part)
Now in Excel 2003, the above formulas will only return a 2nd order fit. the
results are ax^2+bx+c. The first coefficient is 0.
Any thoughts on how generate the third (or forth, or fifth, or sixth) order
fit. This is driving me crazy because it is one of the things I use
constantly. I will be forced to go back to 2000 if I can't resolve this. (And
the idiotic "fx" in place of "=" in the formula bar)

Cheers

Incoherent


  #2   Report Post  
Incoherent
 
Posts: n/a
Default

I should mention that these coefficients I am on about are identical to the
ones generated by the polynomial trend line you can put onto a line or
scatter chart.

"Incoherent" wrote:

In Excel 2000 (and earlier), this example.
A B C D
1 1 1^2 1^3 2.3
2 2 2^2 2^3 4.2
3 3 3^2 3^3 4.7
4 4 4^2 4^3 5.1
5 . . . and so on

=INDEX(LINEST(D1:D5,A1:C5),1) gives the first coefficient for a 3rd order
polynomial fit to the data in column D.
=INDEX(LINEST(D1:D5,A1:C5),2) gives the 2nd,
=INDEX(LINEST(D1:D5,A1:C5),3) the 3rd
=INDEX(LINEST(D1:D5,A1:C5),4) gives the 4th. In the form ax^3+bx^2+cx+d, I
can find the fit for the data. The above formulas give me a,b,c and d.
(This can also be used as a single array formula, dropping the "INDEX" part)
Now in Excel 2003, the above formulas will only return a 2nd order fit. the
results are ax^2+bx+c. The first coefficient is 0.
Any thoughts on how generate the third (or forth, or fifth, or sixth) order
fit. This is driving me crazy because it is one of the things I use
constantly. I will be forced to go back to 2000 if I can't resolve this. (And
the idiotic "fx" in place of "=" in the formula bar)

Cheers

Incoherent


  #3   Report Post  
Incoherent
 
Posts: n/a
Default

OK I resolved it. It was not Excel 2003 after all. Only my own stupidity. A
missing "$" :)



"Incoherent" wrote:

I should mention that these coefficients I am on about are identical to the
ones generated by the polynomial trend line you can put onto a line or
scatter chart.

"Incoherent" wrote:

In Excel 2000 (and earlier), this example.
A B C D
1 1 1^2 1^3 2.3
2 2 2^2 2^3 4.2
3 3 3^2 3^3 4.7
4 4 4^2 4^3 5.1
5 . . . and so on

=INDEX(LINEST(D1:D5,A1:C5),1) gives the first coefficient for a 3rd order
polynomial fit to the data in column D.
=INDEX(LINEST(D1:D5,A1:C5),2) gives the 2nd,
=INDEX(LINEST(D1:D5,A1:C5),3) the 3rd
=INDEX(LINEST(D1:D5,A1:C5),4) gives the 4th. In the form ax^3+bx^2+cx+d, I
can find the fit for the data. The above formulas give me a,b,c and d.
(This can also be used as a single array formula, dropping the "INDEX" part)
Now in Excel 2003, the above formulas will only return a 2nd order fit. the
results are ax^2+bx+c. The first coefficient is 0.
Any thoughts on how generate the third (or forth, or fifth, or sixth) order
fit. This is driving me crazy because it is one of the things I use
constantly. I will be forced to go back to 2000 if I can't resolve this. (And
the idiotic "fx" in place of "=" in the formula bar)

Cheers

Incoherent


  #4   Report Post  
Jerry W. Lewis
 
Posts: n/a
Default

Columns B and C are unnecessary, use
LINEST(D1:D5,A1:C5^{1,2,3})

You have resolved your actual question in this case, but there is an
issue with LINEST in 2003, such that coefficients that are exactly zero
are not to be trusted, although nonzero coefficients (other than assumed
intercept) are correct regardless.

http://groups.google.com/group/micro...e29a8e9b4382fa

Jerry

Incoherent wrote:

In Excel 2000 (and earlier), this example.
A B C D
1 1 1^2 1^3 2.3
2 2 2^2 2^3 4.2
3 3 3^2 3^3 4.7
4 4 4^2 4^3 5.1
5 . . . and so on

=INDEX(LINEST(D1:D5,A1:C5),1) gives the first coefficient for a 3rd order
polynomial fit to the data in column D.
=INDEX(LINEST(D1:D5,A1:C5),2) gives the 2nd,
=INDEX(LINEST(D1:D5,A1:C5),3) the 3rd
=INDEX(LINEST(D1:D5,A1:C5),4) gives the 4th. In the form ax^3+bx^2+cx+d, I
can find the fit for the data. The above formulas give me a,b,c and d.
(This can also be used as a single array formula, dropping the "INDEX" part)
Now in Excel 2003, the above formulas will only return a 2nd order fit. the
results are ax^2+bx+c. The first coefficient is 0.
Any thoughts on how generate the third (or forth, or fifth, or sixth) order
fit. This is driving me crazy because it is one of the things I use
constantly. I will be forced to go back to 2000 if I can't resolve this. (And
the idiotic "fx" in place of "=" in the formula bar)

Cheers

Incoherent




  #5   Report Post  
Incoherent
 
Posts: n/a
Default

Thanks for that suggestion Jerry, thats very useful.
I have been reading about the LINEST issues, fortunately it rarely applies
to how I am using it

Cheers

Incoherent

"Jerry W. Lewis" wrote:

Columns B and C are unnecessary, use
LINEST(D1:D5,A1:C5^{1,2,3})

You have resolved your actual question in this case, but there is an
issue with LINEST in 2003, such that coefficients that are exactly zero
are not to be trusted, although nonzero coefficients (other than assumed
intercept) are correct regardless.

http://groups.google.com/group/micro...e29a8e9b4382fa

Jerry


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
higher order polynomial fit line x-coefficients barrfly Excel Discussion (Misc queries) 3 July 12th 05 09:07 AM
how, in excel, can i generate a number, eg consecutive order nos Verity55 Excel Discussion (Misc queries) 1 June 24th 05 11:42 AM
LINEST bug with cubic polynomials in Excel 2003 byundt Excel Worksheet Functions 3 March 21st 05 02:15 PM
Linest - Why did they do that? cseeton Excel Discussion (Misc queries) 2 March 11th 05 12:45 PM


All times are GMT +1. The time now is 08:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"