Activity Feed › Discussion Forums › Software, CAD & Mapping › Linear Regression with Ordinary Least Squares
Linear Regression with Ordinary Least Squares
dave-karoly replied 2 years, 3 months ago 20 Members · 61 Replies
I think, based upon the first post, I can determine the objective. However, upon seeing the drawing and the point annotations, I think, as a surveying objective, it would be, subject to argument, that a correlation be determined between positions determined as a function of plat dimensions and positions determined from field measurements. In other words, response to “what is the difference from plat determined positions to your measured positions?” is the objective. It is not just fitting measured points to a line but, fitting them to plat positions.
Because, in most jurisdictions, right-of-way dimensions are what they are called to be on the plat, they generally prevail over monument positions. In completing a two-dimensional conformal transformation, it is possible to show the difference or correlation in positions between monuments on the ground and right-of-way positions determined from plat dimensions.
A two-dimensional conformal coordinate transformation solution can be linearized. As such, the solution is less complex or intensive than that for determining a line that minimizes the perpendicular distances from it to a set of points.
Paul Wolf’s book “Adjustment Computations: (Practical Least Squares for Surveyors), 2nd ed, ??1980” presents the solution in Chapter 16, “Two-Dimensional Conformal Coordinate Transformations.” Other similar discussions and publications can be found. However, Wolf’s is specifically presented for surveyors.
Wolf’s discussions are repeated in:
Appendix B, Coordinate Transformations in “Elements of Photogrammetry,” ??1974
and
Section 17.2, Chapter 17 “Adjustment Computations, Statistics and Least Square in Surveying and GIS,” ??1997.The topic is also addressed in:
Section 10.6 Chapter 10, Mikhail & Gracie “Analysis and Adjustment of Survey Measurements,” ??1981- Posted by: @mlschumann
It is not just fitting measured points to a line but, fitting them to plat positions.
I’m not concerned with plat positions. This is not a boundary survey. My only concern is R/W widths as per the plat. Thank you for responding. I appreciate it!
MH I plotted the points in Geogebra, assuming that the smaller number in each pair is the Easting and the larger is the Northing. Three of the four points on the east side are nearly collinear while the three on the west side don’t line up as well and have a different azimuth. Point 251 seems unrelated.
It’s hard to guess what assumptions and math lie behind the Carlson numbers. Some kind of line of best fit can always be computed from a set of coordinated points, but it may not have a meaningful physical interpretation.
From my point of view and if I understand correctly, you have a really cool concept here. Find coordinates for points on both sides of the street, compute two lines of best fit, and see how well the math fits. To be sure, there are caveats, but it’s a nice idea.
The only input is the coordinates, so they have to actually represent what they say they represent. Carry on and perfect it; it’s likely to be valuable.
@gary_g
Go Rexthor go!
MHThanks for your effort! Seems I provided a bogus coordinate file. Please see the correct attached file.
MHIf the “only concern” is right-of-way width, that information is on the plat. The plat right-of-way dimensions, not the monuments, prevail. Unless it is desired to know or determine right-of-way location on the ground, why is there a need for monument positional measurment. — Perhaps, I don’t understand the problem!
This is from the bare bones FooPlot grapher.
The regression equation from https://byjus.com/linear-regression-calculator/ for these points is
y =
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. Seven points is a precious few, but it is indicative, perhaps. 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. Also, the x-coefficients would be very large as the lines approach vertical.
Perhaps treating it like a network and doing a least-squares network adjustment might give you better information. All of the points could be included and the computed measurements might be more meaningful.
Thanks for sharing this. It’s a wonderful exercise for math applied to surveying.
@field-dog I find it a bit confusing to say you are holding the endpoints of the line segment, and at the same time, list offsets for them. It would seem to me that if you hold the endpoints, the line segment is fully determined. What you could then calculate would be the offsets of the intermediate points, which would give a measure of how well or poorly the intermediate points were set, or resisted disturbance.
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 < | > =
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:
And here are my written derivation notes:
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!
- .
@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.
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.
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 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: @mathteacherThere’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.
MH 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.
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 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.
MH 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.
Excellent exercise, thanks again.
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.
Log in to reply.