Thread View: borland.public.cppbuilder.nativeapi
5 messages
5 total messages
Started by Dan
Wed, 14 Mar 2007 20:18
LINEST
Author: Dan
Date: Wed, 14 Mar 2007 20:18
Date: Wed, 14 Mar 2007 20:18
18 lines
1529 bytes
1529 bytes
Hi guys, Probably not a NativeAPI function question, but anyway; I am being tasked to reproduce some of the power that is in the Excel LINEST function in an application. I realize that LINEST uses linear regression and least squares; but I am by no means a math major, the Numerical Recipes in C book has been mildly helpful; but I am still stuck without a solution. I can't use OLE to automate Excel as the application may not always be ran on a PC with Excel. Anyone know any great libraries I could use that allow me to import a data set of X and Y values which will return me the best polynomial fit line, or array of A values for the equation y = A1x^2 + A2x + A3? Dan
Re: LINEST
Author: Bob Gonder
Date: Wed, 14 Mar 2007 22:53
Date: Wed, 14 Mar 2007 22:53
8 lines
1250 bytes
1250 bytes
Dan wrote: >Anyone know any great libraries I could use that allow me to import a Probably Gnumeric http://www.gnome.org/projects/gnumeric/ Or OpenOffice.
Re: LINEST
Author: Dan
Date: Thu, 15 Mar 2007 14:01
Date: Thu, 15 Mar 2007 14:01
8 lines
1305 bytes
1305 bytes
> http://www.gnome.org/projects/gnumeric/ Interesting tool, but gnumeric doesn't have a polynomial fit, which is the part of LINEST I am interested in; the simple line fit (y=mx+b) is easy to duplicate, but I am trying to solve for a1..an in the formula (y=a1x^3 + a2x^2 + a3x + a4); LINEST in Excel gives me that also. Any other ideas?
Re: LINEST
Author: Mark Jacobs
Date: Mon, 19 Mar 2007 13:26
Date: Mon, 19 Mar 2007 13:26
15 lines
1550 bytes
1550 bytes
"Dan" <Dan@do.not.spam> wrote in message news:45f85907@newsgroups.borland.com... > Probably not a NativeAPI function question, but anyway; I am being tasked to > reproduce some of the power that is in the Excel LINEST function in an > application. http://www.nag.co.uk/numeric/fl/manual/html/E02/e02_conts.html The PDF docs that are linked usually contain enough maths to reproduce the function in code. It certainly worked for my skew and kurtosis stats analyses. HTH, -- Mark Jacobs DK Computing http://www.dkcomputing.co.uk
Re: LINEST
Author: Dan
Date: Mon, 19 Mar 2007 18:10
Date: Mon, 19 Mar 2007 18:10
11 lines
1428 bytes
1428 bytes
Thanks to all; I struggled with NR that I finally just went brute force and wrote some code from scratch using the formulas on-line for partial least squares from wolfram. But since folks are out there and are using numerical recipes.. in Chapter 15 they go on to further state that if the values Y were from multiple variables (such as a,b, and c) vs. just X, that simple change of the code could take place to get the correct formulas for a,b, and c. Has anyone done something like that, any place I could look for additional information?
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads