Post Reply 
HP 48G Linear Regression Best Fit Line
12-25-2021, 04:39 PM (This post was last modified: 12-25-2021 04:40 PM by Rodger Rosenbaum.)
Post: #69
RE: HP 48G Linear Regression Best Fit Line
(12-25-2021 03:46 PM)MNH Wrote:  
(12-25-2021 02:41 AM)Rodger Rosenbaum Wrote:  As I mentioned earlier, executing LR does the job. Why would you want to do it yourself?

There is a substantial advantage to letting the HP48 do it. When the HP48 does it, the calculations are done using the internal 15 digit arithmetic. If you do it yourself, you will be doing it with 12 digit arithmetic (if you do the calculations on the HP48) and lose substantial accuracy.

When I execute LR, I get the y-intercept and slope values on the stack. Don't you mean Fit data..., Linear Fit, [OK]? What if I could write a program that would do that automatically? I'm simply thinking about writing a more user-friendly program. Nothing wrong with that, right? I am curious about the summary statistics variables. Where do they reside in calculator memory?

Re-read post #49. Executing LR returns intercept and slope for a least squares fit where the errors are in the Y direction, not in the orthogonal direction. It must calculate the summary statistics to use for the fit.

The summary statistics are stored in built-in variables named ΣDAT, ΣPAR, ΣX, ΣY, ΣX2, ΣY2, ΣXY, NΣ. You can see them all if you bring up the statistics menu and select the 4th item (right after the 3rd item which is "Fit data...") "Summary stats". In that menu item you can check the ones you want to see and press "OK".

I'll work on a program that will do everything after typing in the nx2 matrix of the X and Y values; that much typing can't be avoided.

Merry Christmas. The snow is just starting here in Seattle, a very rare event in the lowlands on Christmas.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 48G Linear Regression Best Fit Line - Rodger Rosenbaum - 12-25-2021 04:39 PM



User(s) browsing this thread: 1 Guest(s)