LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
ktu ktu is offline
external usenet poster
 
Posts: 1
Default Theoretical question: graph & trendlines in Excel

Hi!

I'm not even sure this is the right group, but I'll try anyway:

Currently I'm programmering a small application in C# to calculate a
trendline similar to the one being used in Excel graphs (basically I
have a set of measuring points, and I want a polynomial that fits best
near those points). I'm not using Excel or any Excel VBA functions
directly, but I'm trying to implement their behaviour.

So far I've been able to find out that Excel uses the "least squares
method" fit if you select "Polynomial" as regression type when adding
a trendline. Works like a charm in my program (the german wikipedia
had a nice article about that "least squares" method, as well as the
"numerical recipes" book).

However, if I set an intercept in the "Options" tab (which is where my
function would cross the y-axis), I don't know how to calculate the
function. Main problem in my case is, least squares is based upon
having n+1 equations with n+1 unknowns for a polynomial y=a0*x^0 +
a1*x^1 + a2*x^2 + ... + an*x^n (n=0,1,...,n), which I can solve e.g.
by a Gauss algorithm. However, if I set the intercept to e.g. 0, which
means that a0=0, then I'd be stuck with n+1 equations but only n
unknowns. Can I still solve this with the least squares method? Any
other suggestions? (I do need a polynomial. Splines/Bezier-curves etc.
are nice but not an option for me)

So, bottom line: least squares works fine for me until I want to use
an intercept. If I use an intercept, which approach would I have to
take to get a polynomial for my measuring points?

Any help (or direction to the appropiate group) would be appreciated.

Cheers,
-Kevin

 
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
excel 2007 graph question shallowz Excel Discussion (Misc queries) 1 January 21st 09 04:07 AM
Question about Excel Graph Mike Charts and Charting in Excel 1 October 9th 07 09:22 PM
Workesheet Calculate - strange behaviour and theoretical question... bondcrash[_3_] Excel Programming 1 July 8th 05 07:54 PM
Trendlines in Excel OPNorty Charts and Charting in Excel 1 June 22nd 05 03:49 PM
Logarithmic Trendlines in Excel Quazz Charts and Charting in Excel 1 April 6th 05 12:40 PM


All times are GMT +1. The time now is 04:14 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"