-8

This old question:

Line closest to a set of points

has been flag has duplicated. However, the related question is not the same, because the answer on the canonical suggest to use a linear regression, a method not valid for the kind of problems the duplicated question is asking about.

In particular:

The canonical question asks "best fit line for the scatter data", slightly ambiguous but that can be understood as "minimal 'y' distance" because the questions refers to the "polyfit" method of matlab. From this point of view, the answers are correct, linear regression

However, the "duplicated" asks for "Find the line whose distance from all the points is minimum ?. By distance I mean the shortest distance between the point and the line". This is, in euclidean spaces (I doubt this question refers to theory of relativity) the square root of sum of 'x' AND 'y' distances.

Thus, they are not the same.

In order to verify previous statement, I asked same question in math stack exchange:

line nearest to a set of points

Math experts confirms that the correct method is not a linear regression and gives the correct method.

Taken into account that the issue is a common one, with hundreds of views, what we could do improve the answers (in the duplicate) and/or remove the "duplicate" flag ?

Notes about the flag of duplicate for this meta question:

  • "What can I do if I believe that my question was wrongly marked as a duplicate?" => it is not my quesiton
  • “please edit this question to explain how it is different”? => I prefer to not edit a question is not from myself and it is correctly written.
  • "ask new question" => I prefer do not leave back a question with incorrect answers.
  • "reopen" => no button.

Thus, again, what we can do to solve an issue that can produce errors in some stack overflow readers?

8
  • 1
    Those seem very much like the same thing. An incorrect answer does not invalidate that it's asking the same thing.
    – fbueckert
    Commented Feb 11, 2019 at 19:53
  • @fbueckert: the answers in the canonical are correct for its question (how to implement in C/C++ a matlab function that is a linear regression). However, they are not correct for the "duplicated" one, because this one ask for "minimal distance between points and line". Commented Feb 11, 2019 at 19:55
  • 3
    Answers not being correct doesn't change the fact that they want to do the same thing, in the same language. That's an argument to write a new answer, not reopen the question.
    – fbueckert
    Commented Feb 11, 2019 at 19:56
  • 3
    Even if it wasn't a duplicate, it would've been way too broad. The question doesn't provide the desired fit algorithm (least squares, maximum likelihood, something else), and doesn't provide an attempt to implement it. There are essentially two subproblems (which algorithm do I use to fit a line, how do I implement that algorithm in C++) and neither has any attempt.
    – Erik A
    Commented Feb 11, 2019 at 19:57
  • @StephenRauch: please, read from "Notes about the flag of duplicate for this meta question". Which action do you suggest ? Commented Feb 11, 2019 at 20:11
  • @ErikA: There are nothing ambiguous in "Find the line whose distance from all the points is minimum ?. By distance I mean the shortest distance between the point and the line", except if you work on non-euclidean spaces. Commented Feb 11, 2019 at 20:13
  • 1
    As others have already said: If you think that a question is not a duplicate of another, then edit it to explicitly state why it isn't. Or you ask a new question. This are the two options you have. (Except for gaining a lot more rep and unlock the reopen privilege). I wouldn't know what else anyone of us could do here.
    – BDL
    Commented Feb 11, 2019 at 20:21
  • @pasaba You just proved the algorithm question is an entirely separate question that belongs on MathOverflow. Also, the fact that the question has two answers (one deleted) that both use different algorithms proves it wasn't clear which one the OP wanted to implement.
    – Erik A
    Commented Feb 11, 2019 at 20:29

1 Answer 1

6

If you think that you can provide a better solution than any of the existing solutions, then post your own answer.

If you see problems with another answer, feel free to downvote it if you feel it's not useful, and/or comment on it to indicate how it could be improved.

The questions being marked as duplicates makes addressing this easier, as you only need to post your answer to the canonical, rather than needing to find all of the other times someone has asked the question and repeat the same answer there.

11
  • no possible to add a new answer (because it is old or it is flagged as duplicate?). Commented Feb 11, 2019 at 19:25
  • @pasabaporaqui You add an answer to the canonical question, not any of the duplicates, as I said in the answer. That question is not closed. As I said in my answer, that's the whole point of closing duplicates, to avoid repeating the answer to each question.
    – Servy
    Commented Feb 11, 2019 at 19:27
  • The answer to the "canonical" could be (?) the correct ones. However, these answers are not applicable to the "duplicated" one. If someone applies them, he/she will obtain a wrong algorithm with an error difficult to detect in testing, then ... . Commented Feb 11, 2019 at 19:32
  • 2
    @pasabaporaqui They're asking the same thing. Either you think the existing answers are good answers, in which case, there's nothing to do, or you don't, and you can post what you think is a better answer. Either way, you thinking the existing answer(s) aren't good doesn't make the questions not duplicates.
    – Servy
    Commented Feb 11, 2019 at 19:37
  • original question is "Find the line whose distance from all the points is minimum ?". Duplicated is "I used to work with MATLAB, and for the question I raised I can use p = polyfit(x,y,1) [...] " (a linear regression function). They are NOT the same question. Commented Feb 11, 2019 at 19:41
  • @pasaba do you answer both the same way? Cause duplicate doesn't mean "same question". It means "answered with the same answer"
    – Patrice
    Commented Feb 11, 2019 at 19:44
  • @pasabaporaqui No, the canonical question says that they used to use a given method of a given program to find the line whose distance from all points is the minimum, but that function doesn't exist in the platform they're now using, so they want to know how to implement that in their new platform. Thus the questions are exactly the same, as they're both asking how to find the best fit line. The rest of the details are irrelevant to the question.
    – Servy
    Commented Feb 11, 2019 at 19:44
  • @Patrice: the answers in the canonical are good for this question, but not applicable to the "duplicated" one Commented Feb 11, 2019 at 19:45
  • @pasabaporaqui They're asking the same question though. Either you think that's not a good way to find a best fit line, or you do. Both questions are asking for the same thing, so it can't be a good answer for only one of them.
    – Servy
    Commented Feb 11, 2019 at 19:45
  • @Servy: read the canonical question when he clear states "I expect the algorithm [...] obtain the comparable accuracy of polyfit function in MATLAB". Moreover, canonical says "best fit" (ambiguous, but put in context when matlab function is given) while duplicated says "shortest distance between the point and the line". Matlab function doesn't gives minimal distance between point to line, not they translatios to C/C++ Commented Feb 11, 2019 at 19:50
  • 1
    @pasabaporaqui The question asks how to find a line that's the best fit for a set of points, and said that if they were in matlab they'd use a given function, but they need this for C++, not matlab. So the meaningful part of the question is that they want a best fit line for a set of 2D points, the rest is irrelevant; it's a red herring.
    – Servy
    Commented Feb 11, 2019 at 19:54

Not the answer you're looking for? Browse other questions tagged .