Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Polynomial regression, trendline

5,324 views
Skip to first unread message

Mike

unread,
Mar 6, 2003, 7:32:38 PM3/6/03
to
Hi
Is there a worksheet function (like LINEST or LOGEST)
that gives you the coefficients for a polynomial
regression? Adding a polynomial trendline to charted
data will give you the option of displaying the
polynomial regression equation on the chart... but is it
possible to get this info from a worksheet function??

Harlan Grove

unread,
Mar 6, 2003, 8:30:20 PM3/6/03
to
"Mike" wrote...

You *CAN* use LINEST with polynomials.

LINEST(Y,X^{1,2,3,4})

will return the coefficients for X^4, X^3, X^2, X and the constant, in that
order. Unfortunately, LINEST isn't very well implemented, so it can give
coefficients significantly different than those displayed on the chart.

Jerry W. Lewis has gone over this a few times. Use a Google Groups search to
find what he's written.

--
Public Service Announcement
Don't attach files to postings in nonbinary newsgroups like this one.

Eric Desart

unread,
Mar 6, 2003, 8:29:05 PM3/6/03
to
Hello Mike, Harlan

I just made an Add-In where you can play with those higher order polynomials.
Look at the graphical functions. (there are more topics)
http://www.acoustics-noise.com/Excel/Add-In-Functions.shtml
The Add-In itself is only 92 kB and there's an extensive Help Excel File.

The formula ready to copy and paste as worksheet function is automatically
generated.

Kind regards
Eric


"Harlan Grove" <hrl...@aol.com> schreef in bericht
news:MCS9a.1743$4F4...@www.newsranger.com...

Jerry W. Lewis

unread,
Mar 6, 2003, 11:33:14 PM3/6/03
to
It looks like a nice piece of programming, but the basic premise is
questionable. As Harlan has noted, LINEST (and TREND) can fit
polynomials. The chart trendline is far better numerically than LINEST,
and does not ignore the x values, providing you have specified an XY
chart. Your LINESTplus (and presumably TRENDplus) is as numerically
unstable as LINEST, so all it adds is a different format for returning
the coefficients.

Kennedy and Gentle's book "Statistical Computing" or Lawson and Hanson's
book "Solving Least Squares Problems" would be a good starting point for
removing the numerical problems.

Jerry

Eric Desart

unread,
Mar 7, 2003, 3:50:11 AM3/7/03
to
Hello Jerry,

I do know all of this.
I wittingly also did not mention the XY chart, and be honest, Excel doesn't make
live easier by nowhere mentioning that it uses the equidistant values 1 to n, on
the traditional line and column charts.
It's not for nothing that the question arises regularly.
And I know the limits of the 15 significant digits.

I made the function to make life easier, and what you see (TRENDplus) is what
you get (LINESTplus).
And it also works on input arrays with missing or non-numeric values unlike the
original functions.

So ALL I indeed did what putting things in a right order, as ANY macro does. I
never or nowhere claimed to improve the statistics as calculated by Excel
itself.

If Rodin made a statue, the ONLY thing he did, was stripping a block of stone of
the obsolete pieces around the already existing statue.

I made this to HELP people, and I still think it does.

With kind regards
Eric


"Jerry W. Lewis" <post_a_reply@no_e-mail.com> schreef in bericht
news:3E68211D.1020203@no_e-mail.com...

Eric Desart

unread,
Mar 7, 2003, 5:02:13 AM3/7/03
to
Jerry,

Forgot:
Also see the warning I integrated on the original Help Page.
I think, to the best of my abilities, described what the function does, and how
to use it.

Best regards
Eric

"Eric Desart" <afb...@belgacom.net> schreef in bericht
news:eDYwBfI5...@TK2MSFTNGP12.phx.gbl...

Jerry W. Lewis

unread,
Mar 7, 2003, 7:54:37 AM3/7/03
to
No argument from me about Excel's Help being inadequate/misleading on
the scope and use of LINEST, or the factors to consider in choosing a
chart type. I understood your web page and help file to claim that you
were adding functionality that was not in Excel, rather than providing a
different interface to existing functionality.

Almost as many questions appear in the newsgroups relating to the
numerical problems in LINEST (which you preserve) as those asking how to
fit polynomials.

Eric Desart

unread,
Mar 7, 2003, 8:48:49 AM3/7/03
to
Hello Jerry,

Since you know more about statistics and the way Excel handles this, is there a
specific message you prefer via gougle you went most in-depth?
I'll link it in the file for those people wanting to go deeper in the numerical
site of it.
It's easy to shorten with http://tinyurl.com/
I certainly don't won't to put people on the wrong foot.
(Sorry for my English, I'm Dutch)

Regards
Eric


"Jerry W. Lewis" <post_a_reply@no_e-mail.com> schreef in bericht

news:3E6896A1.6000900@no_e-mail.com...

David J. Braden

unread,
Mar 7, 2003, 8:18:12 PM3/7/03
to
Mike,
I posted, in the excel.chart newsgroup, functions that will extract the
trendline coefficients to a worksheet, as well as evaluate it.

HTH
Dave Braden
Microsoft MVP

In article <021a01c2e441$0e3f6cc0$a501...@phx.gbl>,
"Mike" <mprot...@netscape.net> wrote:

--
ROT13 e-mail: qoe...@ebpurfgre.ee.pbz

David J. Braden

unread,
Mar 7, 2003, 8:34:01 PM3/7/03
to
Oops, correction: I posted in excel.misc. The Google reference is

http://groups.google.com/groups?q=+%22microsoft+public+excel+*%22+author:
Braden&hl=en&lr=&ie=UTF-8&as_drrb=b&as_mind=1&as_minm=3&as_miny=2003&as_m
axd=7&as_maxm=3&as_maxy=2003&selm=dbraden-1C662A.14054705032003%40msnews.
microsoft.com&rnum=3

HTH
Dave

In article <dbraden-9EB4E6...@msnews.microsoft.com>,

Jon Peltier

unread,
Mar 9, 2003, 11:01:33 PM3/9/03
to
Dave -

Coincidentally, the song Cumbersome (7 Mary 3) was playing on my PC when I
came across your post. Honestly. Here's a less cumbersome link:

http://groups.google.com/groups?&selm=dbraden-1C662A.14054705032003%40msnews
.microsoft.com

It still suffers from word wrap, but only once.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

In article <dbraden-2B863F...@msnews.microsoft.com>, David J.
Braden said...

Eric Desart

unread,
Mar 10, 2003, 5:47:55 AM3/10/03
to
Or this one:

http://tinyurl.com/74qu

Regards
Eric



> http://groups.google.com/groups?&selm=dbraden-1C662A.14054705032003%40msnews
> .microsoft.com
>
> It still suffers from word wrap, but only once.
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> http://www.geocities.com/jonpeltier/Excel/index.html
> _______
>
> In article <dbraden-2B863F...@msnews.microsoft.com>, David J.
> Braden said...
> >

> >

David J. Braden

unread,
Mar 10, 2003, 11:14:01 AM3/10/03
to
Thanks. So we can safely cut out all that stuff between "groups?" and
"&selm" ?

Remind me, plz, who has the add-in for extracting this into Excel. You?
Is it Macified?

TIA
Dave B

In article <ePkC#mr5CH...@TK2MSFTNGP09.phx.gbl>,
jonpe...@yahoo.com (Jon Peltier) wrote:

--
ROT13 e-mail: qoe...@ebpurfgre.ee.pbz

David J. Braden

unread,
Mar 10, 2003, 11:17:50 AM3/10/03
to
Whoa, how does that get resolved?!?

TIA

Dave B

In article <b30ac015.0303...@posting.google.com>,
eric....@belgacom.net (Eric Desart) wrote:

--
ROT13 e-mail: qoe...@ebpurfgre.ee.pbz

David J. Braden

unread,
Mar 10, 2003, 11:19:55 AM3/10/03
to
Eric,
just posted a dumb question. Got it now. Thanks for the heads up!

Dave

> Or this one:
>
> http://tinyurl.com/74qu
>
> Regards
> Eric
>

--
ROT13 e-mail: qoe...@ebpurfgre.ee.pbz

Eric Desart

unread,
Mar 12, 2003, 12:28:25 PM3/12/03
to
Hello Jerry,

For what it's worth.
I tested the LINEST function with calibrated NIST data sets.

Did some more tests too.
I programmed also (for myself, still to be improved) a multi-linear
regression (least square), basically what linest does.
Conclusion: LINEST has no numerical problems (except for the 15 digit
limit, which prevent top accuracy).
Excel adds seemingly additional algorithms for damping, smoothing,
averaging interpolating or whatever, before applying a multi-linear OR
multi-exponential regression.
Based on the NIST data set Excel clearly generates a multi-exponential
trend-line (not a multi-linear regression at least not on that test).
In other cases Excel seems to do a multi-linear approach.
So they have somehow a decision tree.
In the NIST example I tested the multi-linear approach is at least as
good (if not better) than the the multi-exponential approach the Excel
graph returned.

My personal vision: there is nothing wrong with LINEST. Excel does
what it says it does, returning a multi-linear least squares
regression.
Question is does this approach fits the problem at hand or not?

But that's different than interpreting LINEST as unstable or having
numerical problems.

And have the feeling (but don't know) that excel uses some kind of
decision tree in order to define the to be used algorithm's.

This are just impressions, but after a lot of work.

I referred on my site to related messages of you in Google as well as
to the Add-In of David J. Braden.

The Nist links and the others are noted at the bottom of the related
page.
http://www.acoustics-noise.com/Excel/Add-In-Functions.shtml
I entered much more related info in my download than before.
Still think it can help people and it refers to the comments you gave
and David's Add-In.

With kind regards
Eric


"Eric Desart" <afb...@belgacom.net> wrote in message news:<u2QHAGL5...@TK2MSFTNGP09.phx.gbl>...

Martin Brown

unread,
Mar 12, 2003, 1:03:29 PM3/12/03
to

Eric Desart wrote:

> For what it's worth.
> I tested the LINEST function with calibrated NIST data sets.

It works OK with most of the NIST datasets. But if you translate the data with a relatively trivial
constant shift along the x-axis by a constant offset so that x' = A + x the results will be incorrect
and it becomes numerically unstable. This is a recognised pathological behaviour in this type of
problem.

The polynomial algorithm used in the chart polynomial does not share this intrinsic instability problem.

> Conclusion: LINEST has no numerical problems (except for the 15 digit
> limit, which prevent top accuracy).

You are wrong. It only takes one counter example to prove LINESTs weaknesses on polynomial fits.
Try it with the sample data from a previous thread:

http://groups.google.be/groups?hl=en&lr=&ie=UTF-8&selm=cEe%254.29665%24Gj5.531879%40news-east.usenetserver.com

> In the NIST example I tested the multi-linear approach is at least as
> good (if not better) than the the multi-exponential approach the Excel
> graph returned.
>
> My personal vision: there is nothing wrong with LINEST. Excel does
> what it says it does, returning a multi-linear least squares regression.
> Question is does this approach fits the problem at hand or not?
>
> But that's different than interpreting LINEST as unstable or having
> numerical problems.

It has as can be clearly demonstrated using the test data that I thought Jerry had already pointed out.

Several other packages share the same numerical flaw - much to my surprise. The only way to be sure that
the answer that LINEST gives you on higher order polynomial fits is correct is to explicitly check it.
LINEST can be numerically unstable on problems with awkward data involving cubics or higher
polynomials.

Regards,
Martin Brown

Eric Desart

unread,
Mar 12, 2003, 1:03:22 PM3/12/03
to
Martin,

Thanks for the link.
Going to check it out.
And if I'm wrong I humbly accept.
I'm learning.

Best regards
Eric

"Martin Brown" <martin...@pandora.be> schreef in bericht
news:3E6F67C1...@pandora.be...

Eric Desart

unread,
Mar 12, 2003, 11:11:19 PM3/12/03
to
Hello Martin,

Effect of number of significant digits on a least square multi-linear
regression.

> Try it with the sample data from a previous thread:

> http://tinyurl.com/7dl0 (I shortened your link)

Well I did! I think the numbers speak for themselves.
The message states that LINEST, the Add-In regression and Math Lab all return
the same values.
What then is meant with unstable?
It are basic multi-linear regression analysis's. The function returns the
values limited in accuracy by the available digits (can partly be substituted by
additional algorithms).

Compare the effect by the available significant digits below. Having enough
digits available allows accurate calculation.
So how does Excel it. Maybe something comparable with the Decimal Type (28
digits).
Or does Excel use additional algorithm's?

You'll notice in the numbers below that you won't find the LINEST data. This is
caused by the program introducing a secondary aid regression on the Covariance
to improve the model. This has more effect on the small number of digits.

A second possibility is introducing a conditioning of the input data. I did this
already in a beta version of my add-in function but removed it afterwards since
on the examples I tested it had relative little effect.
But on this example you referred to the effect is more significant, so I intent
to re-introduce it.

Still I think that LINEST and TREND are very useful for most practical purposes.
Also in the example you gave the LINEST fitting isn't that bad. The important
thing is final correlation coefficient ( more than the factors of the regression
formula itself).

LINEST:
6 -2.44965793
5 343.7613651
4 -20056.29479
3 622756.8006
2 -10853895.24
1 100677301.1
0 -388274281.1
Correlation R2 : 0.999967044

LINEST with added input conditioning:
6 -1.13762787
5 158.6774908
4 -9201.469993
3 283983.0497
2 -4919892.543
1 45366638.27
0 35407.26667
Correlation R2 : 0.999986673

LINEST with doubled added input conditioning (to improve?? annoying rounding
problems caused by 15 digits):
6 -1.13762787
5 158.6774908
4 -9201.469993
3 283983.0497
2 -4919892.543
1 45366638.27
0 1.46671E-07
Correlation R2 : 0.999986673


Original 6th order formula as returned by the graph:

EXCEL GRAPH
6 -1.15362917189486
5 160.93441309221
4 -9333.81485847756
3 288112.860438168
2 - 4992220.17147523
1 46040702.87
0 - 176557154.080293
Correlation R2 : 9.999866828230100E-01

The following data is calculated by the same model. The difference in numbers
is exclusively caused by the allowed number of digits throughout the
calculation.

28 SIGNIFICANT DIGITS (equals the CDec function or Decimal Type)
6 -1.153629170966401114357982599
5 160.9344129554329820384829032
4 -9333.814850094671793053549844
3 288112.8601650590103306944896
2 -4992220.166492299906363719151
1 46040702.81704590798441001257
0 -176557153.8868400882437023107
Correlation R2 : 0.9999866758337027558350520019

25 SIGNIFICANT DIGITS
6 -1.153629170733138671086384
5 160.9344129225303146604813
4 -9333.814848165163056226786
3 288112.8601048453447022926
2 -4992220.165437683616939751
1 46040702.80721673170238136
0 -176557153.8487554030754403
Correlation R2 : 0.9999866758337027558350513

20 SIGNIFICANT DIGITS
6 -1.1536145666832081819
5 160.93235265891410311
4 -9333.6940106048246946
3 288109.08860584020528
2 -4992154.0995528953799
1 46040086.973066671625
0 -176554767.35233808089
Correlation R2 : 0.99998667583370026204

18 SIGNIFICANT DIGITS
6 -1.15234190977653184
5 160.752810440808685
4 -9323.16344865017018
3 287780.411513573714
2 -4986396.53841153789
1 45986417.0527469225
0 -176346781.471597567
Correlation R2 : 0.999986675814326352

17 SIGNIFICANT DIGITS
6 -1.1426258599641945
5 159.38212812183351
4 -9242.7713204528695
3 285271.28185768147
2 -4942444.0100437283
1 45576715.270386361
0 -174759103.82558858
Correlation R2 : 0.99998667441812068

16 SIGNIFICANT DIGITS
6 -1.408092996464547
5 196.8184792905007
4 -11437.62217523071
3 353748.916092033
2 -6141510.579470779
1 56749488.23589995
0 -218039309.3444705
Correlation R2 : 0.9999859200765614

15 SIGNIFICANT DIGITS
6 3.17367963062605
5 -449.255891750522
4 26438.0239167008
3 -827848.877531191
2 14547037.4995784
1 -136008972.261474
0 528594351.11906
Correlation R2 : 0.99976813668216

14 SIGNIFICANT DIGITS
6 0.79034538578603
5 -112.910887515
4 6704.0109783463
3 -211709.13148656
2 3750251.1815016
1 -35331326.85633
0 138309353.67662
Correlation R2 : 0.99994231676963

13 SIGNIFICANT DIGITS
6 -9.113295319037E-3
5 -0.3613131051461
4 116.6003452228
3 -6539.426181676
2 163848.1990699
1 -1971344.529071
0 9305652.899348
Correlation R2 : 0.9999713628748

12 SIGNIFICANT DIGITS
6 -2.73508955172E-3
5 -0.737589657019
4 107.802655862
3 -5297.88167671
2 125125.97559
1 -1452097.28105
0 6680734.73544
Correlation R2 : 0.999969780182

Best regards
Eric

"Martin Brown" <martin...@pandora.be> schreef in bericht
news:3E6F67C1...@pandora.be...
|
|

Eric Desart

unread,
Mar 13, 2003, 4:53:13 AM3/13/03
to
Sorry this one was a typo

| LINEST with doubled added input conditioning

Was
| Correlation R2 : 0.999986673

Must be
Correlation R2 0.999987291

Eric

"Eric Desart" <afb...@belgacom.net> schreef in bericht

news:OovKZfR6...@TK2MSFTNGP09.phx.gbl...

Eric Desart

unread,
Mar 13, 2003, 5:13:58 AM3/13/03
to
Once more,

Forget this one completely:

| | LINEST with doubled added input conditioning

Coefficients OK but constant needs fix correction
| | 0 1.46671E-07
I must check this one, no time now.

Rest should be OK

"Eric Desart" <afb...@belgacom.net> schreef in bericht

news:uNGsWeU6...@TK2MSFTNGP11.phx.gbl...

Jerry W. Lewis

unread,
Mar 13, 2003, 9:07:15 AM3/13/03
to
The issue with LINEST is the same issue that occurs between VARP() and
DEVSQ()/COUNT(), except with LINEST, the problem is extended to multiple
dimensions, where it is manifested more easily.

The formula underlying VARP (like the formula underlying LINEST) is
mathematically exact, so it will return the right answer when it does
not experience numerical difficulties.

For VARP, it is easier to see when numerical difficulties will appear.
COUNT()*SUMSQ() and SUM()^2 can become large enough that the interesting
part of the data does not survive the IEEE double precision limit of 15
figures. That will happen if
- there is a large constant shift: VARP(x,x+1) should be 0.25
regardless of x, but it returns zero for x>=1E8, although
DEVSQ()/COUNT() continues to give the right answer,
- the same thing can happen with more realistic data if the number of
observations is large.

Depending on the vagaries of binary approximation and rounding, the
numerator in VARP can even be numerically negative. If you search the
archives, you will find instances where people are trying to figure out
why Excel returned a negative R^2 -- this is why.

Excel numerically solves the normal equations, which are expressed using
matrices and vectors as
X'X b = X'y
I presume that you did this explicitly in your Add-in. But the
diagonals of X'X are SUMSQ() for each column of the X matrix. The
result is even more opportunity to exceed the finite precision of the
calculations. For the example that Martin Brown cited, the condition
number of X'X is ~10^30. Basically that means that you would need
quadruple precision instead of double precision to recognize that X'X is
not singular. That you get an answer at all is due to the absence of
singularity checks in MINVERSE(), but the coefficient values are just
noise. Any package (including SAS) that fits polynomials by forming the
normal equations will not be able to estimate these coefficients
accurately. Excel's trendline, Minitab, S-PLUS, R, Origin, etc. fit
polynomials without forming the normal equations (probably by orthogonal
rotations) and so are able to get accurate results even on this
numerically difficult problem.

Excel's trendline and Minitab get 9 correct figures per coefficient on
this problem (Minitab is marginally better). S-PLUS and R get 8 correct
figures per coefficient. I have not figured out how to get Origin to
display more than its default number of figures, so I don't know exactly
how well it did.

Jerry

Eric Desart wrote:

> Hello Jerry,
>

Eric Desart

unread,
Mar 13, 2003, 9:52:06 AM3/13/03
to
Hello Jerry,

Thanks for extensive explanation.
Just responded now to say that I have a bit trouble to define the intercept
here.

LINEST with added input conditioning:

0 35407.26667

This one is not right. Will find the solution myself.
Come back on it later.

Best regards
Eric

"Jerry W. Lewis" <post_a_reply@no_e-mail.com> schreef in bericht

news:3E7090B5.2090907@no_e-mail.com...

Harlan Grove

unread,
Mar 13, 2003, 2:45:56 PM3/13/03
to
"Martin Brown" wrote...
..

>The polynomial algorithm used in the chart polynomial does not share this intrinsic instability problem.
..
> . . . It only takes one counter example to prove LINESTs weaknesses on >polynomial fits. Try it with the sample data from a previous thread:

[indirect link]

http://makeashorterlink.com/?T5DD21BC3

Given the data,

_X__ __Y__
20.0 19209
20.5 20627
21.0 22177
21.5 23877
22.0 25730
22.5 27794
23.0 30165
23.5 32792
24.0 35610
24.5 38738
25.0 42113
25.5 46138
26.0 50652
26.5 55283
27.0 60204

The charting polynomial trendline tool gives the fitted equation

y = -1.15362917189486 x6 + 160.93441309221 x5 - 9333.81485847756 x4
+ 288112.860438168 x3 - 4992220.17147523 x2 + 46040702.8652861 x
- 176557154.080287

LINEST(y,x^{1,2,3,4,5,6}) gives the following coefficients.

x6 -2.44965792987106
x5 343.761365071369
x4 -20056.2947932984
x3 622756.800641569
x2 -10853895.2375726
x 100677301.143236
const -388274281.109756

Not close. However, at the cost of a lot of redundant calculations, the charting
polynomial trendline tool's coefficients can be approximated with worksheet
functions only. Using cells D17:D23,

D17: x6 -1.15362917096766
=INDEX(LINEST(Y,(X-AVERAGE(X))^{1,2,3,4,5,6}),1)

D18: x5 160.93441296049
=INDEX(LINEST(Y-MMULT(X^(7-COLUMN(INDIRECT("A:"&CHAR(ROW()+47)))),D$17:D17),
(X-AVERAGE(X))^COLUMN(INDIRECT("A:"&CHAR(87-ROW())))),1)

D19: x4 -9333.81485068754
=INDEX(LINEST(Y-MMULT(X^(7-COLUMN(INDIRECT("A:"&CHAR(ROW()+47)))),D$17:D18),
(X-AVERAGE(X))^COLUMN(INDIRECT("A:"&CHAR(87-ROW())))),1)

D20: x3 288112.860193078
=INDEX(LINEST(Y-MMULT(X^(7-COLUMN(INDIRECT("A:"&CHAR(ROW()+47)))),D$17:D19),
(X-AVERAGE(X))^COLUMN(INDIRECT("A:"&CHAR(87-ROW())))),1)

D21: x2 -4992220.16715361
=INDEX(LINEST(Y-MMULT(X^(7-COLUMN(INDIRECT("A:"&CHAR(ROW()+47)))),D$17:D20),
(X-AVERAGE(X))^COLUMN(INDIRECT("A:"&CHAR(87-ROW())))),1)

D22: x 46040702.8248271
=INDEX(LINEST(Y-MMULT(X^(7-COLUMN(INDIRECT("A:"&CHAR(ROW()+47)))),D$17:D21),
(X-AVERAGE(X))^COLUMN(INDIRECT("A:"&CHAR(87-ROW())))),1)

D23: const -176557153.923335
=AVERAGE(Y-MMULT(X^{6,5,4,3,2,1},D$17:D22))


If you give me a few days (weeks, months) I may be able to figure out why this
works, as in a formal proof. I have a feeling it has to do with the interaction
between linear regression and factoring the polynomial. It's been a LONG time
since I did any heavy duty applied algebra, so if anyone else wants to work on
this please do. Also, torture test it.

It doesn't match up exactly with the charting polynomial trendline tool, but
it's a damn sight closer than a single unmodified LINEST(y,x^{1,2,3,4,5,6}).

Eric Desart

unread,
Mar 13, 2003, 6:09:20 PM3/13/03
to
I've programmed a possible solution, still need to adjust auto creation
formulas themselves.

Further cleaning it up, and testing for mistakes. Lots of work.
For this example resembles Excel results. Analytic approach.
Based on LINEST and TREND

MODIFIED FUNCTION
Excel Graph 6th order 7th order LINEST/TREND
19195.7 19196.3 19195.1 19145.6
20668.2 20667.0 20668.6 20766.0
22161.8 22161.5 22163.1 22182.6
23830.7 23831.5 23830.9 23772.6
25726.9 25727.7 25725.4 25659.7
27851.3 27851.5 27849.6 27832.1
30193.4 30192.9 30193.1 30233.0
32756.8 32755.9 32758.3 32823.0
35572.3 35571.8 35574.6 35615.4
38698.1 38698.2 38699.0 38684.1
42206.4 42207.2 42204.8 42143.1
46158.1 46158.8 46155.2 46099.7
50563.2 50563.0 50562.7 50579.0
55329.4 55328.2 55333.5 55421.2
60196.7 60197.3 60195.0 60151.9

Maximum absolute deviation with known y's
93.44239399 94.23166196 91.79513707 138.9917549

Median lowest and highest deviation
2.335810035 2.628386796 1.272544616 17.2842921

Correlation R2
0.999986683 0.999986673 0.999986866 0.999967044

Regards
Eric


"Harlan Grove" <hrl...@aol.com> schreef in bericht

news:Ud5ca.714$S4....@www.newsranger.com...

Jerry W. Lewis

unread,
Mar 14, 2003, 9:33:48 AM3/14/03
to
The least squares coefficients for the example that Martin Brown cited are

power coef (rounded to 15 figures)
0 -176557153.886878
1 46040702.8170556
2 -4992220.16649334
3 288112.860165119
4 -9333.81485009658
5 160.934412955466
6 -1.15362917096663

Eric Desart

unread,
Mar 16, 2003, 6:27:38 PM3/16/03
to
Hello Jerry, others,

Sorry for nor responding.
I hadn't seen this reply (haven't looked in-between).
My Add-In is almost ready. Think I'm relative close to Excel Graph results.
When finished let you know.

I just have one more question for you or the others.
I integrated also the basics of LOGEST/GROWTH.
Problem:
What's the difference between R2 for LINEST and for LOGEST?
I thought they only take resulting polynomial versus known y's into account.

Av = AVERAGE(IF(Check,Known_y.s))
Tmp = SUM(Known_y.s-Av)^2
SSresid = SUMXMY2(Trendline,Known_y.s)
SSreg = Tmp-SSresid
r2 = MAX(0,SSreg/Tmp)

Hope didn't make a typo (comes from Dutch Excel)

I don't see how LOGEST or LINEST can make a difference.
I clearly don't see something here.
LOGEST calculates r2 via a different manner. The above approach fits LINEST.
Don't understand how.

Many thanks
Kind regards
Eric

"Jerry W. Lewis" <post_a_reply@no_e-mail.com> schreef in bericht

news:3E71E86F.2020702@no_e-mail.com...

Eric Desart

unread,
Mar 16, 2003, 7:03:29 PM3/16/03
to
Sorry all,

Found the answer
was typo in previous one .

LINEST:
| Av = AVERAGE(Known_y.s)
| Tmp = SUM((Known_y.s-Av)^2)


| SSresid = SUMXMY2(Trendline,Known_y.s)
| SSreg = Tmp-SSresid
| r2 = MAX(0,SSreg/Tmp)

LOGEST
Is dito but based on LN(Known_y.s) and LN(Trendline)

Eric


"Eric Desart" <afb...@belgacom.net> schreef in bericht

news:OMlGrTB7...@TK2MSFTNGP12.phx.gbl...

0 new messages