Post Reply 
HP 48G Linear Regression Best Fit Line
12-19-2021, 01:08 AM
Post: #27
RE: HP 48G Linear Regression Best Fit Line
(12-18-2021 10:13 PM)MNH Wrote:  
(12-11-2021 05:38 PM)Rodger Rosenbaum Wrote:  The result will be the slope and intercept for the line which minimizes the SSE with the deviation from the line in the orthogonal direction.

My results are:


which looks strange to me, probably because I don't know a lot about statistics. My ΣDAT is





In the matrix editor I entered the 'x' data in column 1 and the 'y' data in column 2. Is that correct?

The actual survey data is

PT # Northing Easting Elevation Description

248 29945.480 921.773 0.000 PROP_COR
249 30002.951 922.245 0.000 PROP_COR
250 30006.678 982.237 0.000 PROP_COR
251 30058.926 921.687 0.000 PROP_COR
252 30114.903 923.001 0.000 PROP_COR
253 30119.876 983.350 0.000 PROP_COR
254 30221.977 924.059 0.000 PROP_COR

Please see the attached file (thumbnail) to see the relationship of the points. North is straight up.

After you enter the data into ΣDAT you need to get into the statistics menu and execute the "Fit data" function (it's the 3rd function in the list). Doing this will fill in all the summary statistics such as ΣX, ΣY, ΣXY, etc. Without doing this the LR function, and the ORTH program won't work.

A check for all the data being entered is this: Recall ΣDAT to the stack; you should see a two column, 7 row matrix. Execute the calculator's ABS function. This will calculate the square root of the sum of the squares (the Frobenius norm) of all the elements of the ΣDAT matrix. You should get 79589.685862

If this is ok, try the LR function (ordinary least squares) and you should get on the stack (reverse order from what ORTH will get):

Intercept: 30074.5044063
Slope: (-7.71315429794E-3)

Now clear the stack and execute ORTH; you should get on the stack:


I also checked the ORTH result with a method using the singular value decomposition and got exactly the same result.
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-19-2021 01:08 AM

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