Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Deming/Orthogonal regression #1017

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JesperGr
Copy link

Deming/Orthogonal regression, least-Squares fitting the points in the 2D dataset (x,y) to a line
a*x + b*y + c = 0
For delta equal 1 (the default value), this is performing orthogonal regression, minimizing the sum of squared perpendicular distances from the data points to the regression line.

Discussed/suggested here:
#786

Questions:

  • Is Fit.Line2D a good name?
  • Where to put StandardLineToYxLine?

@jkalias
Copy link
Member

jkalias commented Jun 24, 2023

  • Is Fit.Line2D a good name?

I think that Fit.Deming would be more appropriate. Line2D seems like it performs the "usual" least squares fitting

  • Where to put StandardLineToYxLine?

This is used purely for testing purposes, I think it is more appropriate in the testing class FitTests.StandardLineToYxLine

src/Numerics/LinearRegression/DemingRegression.cs Outdated Show resolved Hide resolved
src/Numerics/LinearRegression/DemingRegression.cs Outdated Show resolved Hide resolved
/// <param name="delta">Ratio of variances of x and y data, var(y)/var(x). Default value is 1</param>
/// <returns> returning its best fitting parameters as (a, b, c) tuple.</returns>
/// <remarks>
/// Solution algorithm as described from:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find the reference, only a wikipedia linke. Could you provide a pdf link or something similar?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was the best link I could find.

src/Numerics/LinearRegression/DemingRegression.cs Outdated Show resolved Hide resolved
@JesperGr
Copy link
Author

JesperGr commented Aug 8, 2023

I like the Line in the name, because it is very similar to the SimpleRegression. But I am fine with Deming as well, so I have updated the Fit.Line2D to Fit.Deming. And moved the StandardLineToYxLine to the FitTests - I will then just keep my own line tools alive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants