Notifications
Clear all

Linear Regression with Ordinary Least Squares

62 Posts
20 Users
0 Reactions
9 Views
(@leegreen)
Posts: 2195
Customer
 

@MathTeacher

Here are a few linear regression reports from InRoads. You are correct, it appears at least one point is on the opposite side of the line or arc, they are all perpendicular or radial. The last report is along an arc.

Notice the InRoads report shows a nice text graph on the right side

using <?ÿ |?ÿ >?ÿ =

?ÿ

?ÿ

 
Posted : 06/12/2021 7:45 am
(@mathteacher)
Posts: 2081
Registered
 

The question of understanding what regression is doing sent me back to my old business statistics textbook from college, ca 1965 or so. The book had formulas for computing the regression coefficients, but being a math major, I was compelled to derive them. There are two necessary conditions: 1) The sum of the calculated y's equals the sum of the original y's, and 2) The sum of the distances from the calculated y's to the original y's is a minimum. There are other assumptions for statistical validity including skedasticity, normalcy, and other stuff that we amateurs routinely ignore.

Anyway, here are the formulas from the textbook:

PXL 20211206 164942776

And here are my written derivation notes:

PXL 20211206 165140886

Finding a minimum is a calculus problem, so there are derivatives involved. As is very often the case, formulating the problem is harder than doing the math.

Hope this helps and thanks again for sharing!

?ÿ

 
Posted : 06/12/2021 9:20 am
(@bill93)
Posts: 9834
 
FD lines
 
Posted : 06/12/2021 9:26 am
(@mathteacher)
Posts: 2081
Registered
 

@bill93?ÿpretty well nailed how close everything is. This drawing puts in the two best-fit lines on the west and east sides. Because the east side has only two points, the line goes through both of them. Not so for the west line with its 5 points. The line does not have to go through any of them.

image

The drawing shows some different approaches to measuring the width. At the top, a line is drawn perpendicular from FB254 to the east line. In the middle, a line perpendicular to the east line is drawn to intersect the west line. Point C is the point of intersection. The bottom example is equivalent to the top one done a slightly different way.

The east and west lines are not parallel, so no measurement between them can be perpendicular to both. All three of the computed measurements are within striking distance of 60 feet. Bill's drawing confirms that and the "relatively" small Carlson adjustments do, too.

At best, the math is a check. How well the truth, that which is on the ground, is a matter of professional judgment. I just cipher, rarely go outside, and am a poor judge of many things, but, depending on how recent the work was done, it doesn't seem too bad to me.

Thanks again, @field-dog for posting this. it's a good concept that provides a great exercise in the intersection of ground and math.

?ÿ

 
Posted : 06/12/2021 1:55 pm
(@lurker)
Posts: 925
Registered
 

So Field Dog, out of curiosity, what has been determined by the above results? What is the end conclusion that we are trying to reach?

 
Posted : 06/12/2021 2:06 pm
(@field-dog)
Posts: 1372
Registered
Topic starter
 
Posted by: @mathteacher

The x-coefficient is almost zero which tells us that the regression line is almost horizontal (due east?) which may be what you're looking for.

The line is running N. if you start on pt. 248 (W. side) and go in ascending order.

Posted by: @mathteacher

There's no check on the right-of-way width, though, and having only two points on the east side diminishes the value of two separate regressions.

My boss said he likes to use a best fit line on one side only and check to points on the other side using perpendicular offsets. The plat right-of-way width must rule so we don't take away anyone's frontage. Any minor discrepancies in right-of-way width must favor the property owners.

 
Posted : 06/12/2021 6:47 pm
(@mathteacher)
Posts: 2081
Registered
 

@field-dog?ÿ

That makes sense and is a great approach from a math viewpoint. The regression line with nearly-zero x-coefficient included all of seven points, those on both sides of the road. I misunderstood the problem. Including points 252 and 253 and points 249 and 250 so nearly in east-west alignment in the regression pretty well guaranteed that result.

All in all, it's just a great problem from several different viewpoints. There's the math, the ground-math connection, communication, interpretation and so on.?ÿ

A really good opportunity to think and learn.

 
Posted : 07/12/2021 4:34 am
(@mathteacher)
Posts: 2081
Registered
 

If you'll permit me one last lick at this poor old horse, what Carlson did is regress the Eastings on the Northings. Easting is the dependent variable and Northing is the independent variable. Their offsets are the residuals from the exercise. That makes perfect sense in the context of the problem.

The attached spreadsheet duplicates the Carlson offsets using Excel regression commands. That's still not complete understanding, but Excel can be duplicated by using textbook formulas.

It's good to see consistency among the black boxes.

?ÿ

 
Posted : 07/12/2021 9:43 am
(@field-dog)
Posts: 1372
Registered
Topic starter
 
Posted by: @mathteacher

If you'll permit me one last lick at this poor old horse, what Carlson did is regress the Eastings on the Northings. Easting is the dependent variable and Northing is the independent variable. Their offsets are the residuals from the exercise. That makes perfect sense in the context of the problem.

Thanks for identifying the process! The attached pages might be interesting to you.

Carlson P. 779
Carlson P. 778
 
Posted : 07/12/2021 5:55 pm
(@mathteacher)
Posts: 2081
Registered
 

@field-dog?ÿ

Indeed. By the way, there's an error in the formula that calculates azimuth in the spreadsheet. it should be:

=Degrees(Atan(E3))

That gives azimuth = 0 .47675 degrees, almost north on the map and it may be north after adjusting for convergence.

There's a cool way to use Excel Solver for regression. Here's the setup for this problem, and it's critical to define tight constraints, but it's educational in that it focuses us on what we're trying to do while Excel chugs through the arithmetic. It also works on curves, as long as an equation can be defined.

image
image
image

Excellent exercise, thanks again.

 
Posted : 08/12/2021 3:46 am
(@chris-bouffard)
Posts: 1440
Registered
 

I'm lost on the reasoning for using the best fit on a ROW, the ROW is the ROW and it is where it is, not where it fits best.

 
Posted : 09/12/2021 1:24 pm
(@norman-oklahoma)
Posts: 7610
Registered
 

@chris-bouffard?ÿ

You find 8 pins along a right of way. You run the best fit and find that they all fall no more than 0.04' this way or that of a best fit line. Except 1 that falls 1.00 off. You apply the virtual hammer to 7 and call it a straight line. The eighth is a 1 foot offset. Done in 5 minutes.?ÿ Sure, you could reach the same conclusion by fussing with it for a couple hours but why would you want to?

 
Posted : 09/12/2021 2:51 pm
(@rover83)
Posts: 2346
Registered
 
Posted by: @chris-bouffard

I'm lost on the reasoning for using the best fit on a ROW, the ROW is the ROW and it is where it is, not where it fits best.

I'll ask the same question I asked upthread: would you / do you place angle points at every single monument you find along a ROW that was platted and/or dedicated as a straight line, no matter the positional tolerance or residuals?

 
Posted : 09/12/2021 3:04 pm
(@chris-bouffard)
Posts: 1440
Registered
 

@norman-oklahoma I don't think any of us would have a concern with 0.04, that was not my point.?ÿ The ROW became what it is upon dedication and acceptance.?ÿ If your example of 0.04 fits are not in accordance with the original intention at the time of conveyance, that "fit" is meaningless and thr ROW is where it is.

I recently came completed a survey next door to the father of somebody that developed the block that the father built his home on.?ÿ The father objected to a new home being built on the ajacent lot, even though he did not own it.?ÿ He object from the beginning and when the son developed the block, he sought and got approval for a 20 lot subdivision but refused to pay his Surveyor to momument it.

I (my crews) surveyed surveyed the surrounding blocks around the PIQ and determined that pins found on the father's property were somehow shifted by 2', parralell to the road frontage and on my PIQ.?ÿ He claimed the new home violated the minimum side yard set back by that 2' and wanted to be compensated.

In come the Legal Eagles.?ÿ Fortunately, the Town Engineer and Municipal Attorney were able to understand the proofs laid before them and it was a dine deal with the other Surveyor not even replying to multiple calls and certified mailings to participate in the dispute.

The father's house was on a corner, it had two road frontages, both based on an errant filed plan.?ÿ Do we shift one ROW 2', or do we talk about the original intention??ÿ

 
Posted : 09/12/2021 6:47 pm
(@chris-bouffard)
Posts: 1440
Registered
 

@rover83 absolutely not.?ÿ The determination would be made on the best available evidence, but, as I have said before, The ROW is where where it is if it were improved in accordance with the original intention, and, sometimes the best fit does not comply with the original intentions.

Are you going to hold the best fit, or, the original intentions?

 
Posted : 09/12/2021 7:03 pm
Page 3 / 5