Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Least square polynomial fit to data in table!

Status
Not open for further replies.

VenusInBlueJeans

Technical User
Jun 13, 2003
6
0
0
IT
Hi, guys!

I have a problem. I have a two column Access table (x and y values), and I need vba code which fits a 2nd order polynomial using least square method, and adds the three coefficients in the next three columns of the Access table.
(Pol fit like: y=A+B*x+C*x*x)

Thx for helping out!
/M
 
Thx Jebry!

However, I was looking for a function in VBA to use in my Access Data Base. Is it not possible to do?

Thx
/M
 
Or a possible alternative for me could be, to open excel, perform regression and then just have the cofficients added to the table in Access.
Can that be done automatically and also have the excel window as hidden as possible?

/M
 
you would need to add the reference to the excel library. As far as I know, the excel ver only does linear regression (Y = mx + b). but then being a !big fan of excel (or at least the way it is generally used), I have not really looked into it deeply.

There is a 'paper' "ORNL-4264", Contract No. W-7405-eng-26 by E. Schonfield, which includes the FORTRAN code for several (eight?) equation models using the Weighted least squares method. I have (several times) toyed with converting this to VB (NOT Access), but have never quite gotten around to the complete testing. The 'original' paper is (if it can be found) is in the public domain, as a result of the development under a government contract , and hte conversion fromF ORTRAN to BASIC is relatively easy so, if you do not find a better source, you might consider this.





MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top