Given a data set where there exists multiple different observed y-values for a given x-value, how do I calculate Mean Squared Error? The formula implies that I subtract the predicted from a singular observed value, but what if there is multiple?

  • 1
    $\begingroup$ What do you mean there are multiple? Are multiple values linked to a single observation or does it just means that for a given $x$ you happened to have multiple datapoints? $\endgroup$
    – Firebug
    Oct 5 at 0:55
  • $\begingroup$ @Firebug For a given x value, there are multiple data points. i.e. (1,2), (1,3), (1, 5), etc. $\endgroup$
    – feonyte
    Oct 5 at 0:57

Just take the squared error multiple times.

If you have {...,(1,1),(1,2),(1,3),...} and you predict y=2 at x=1, the error sum of squares would be


Then, just divide it by the number of observations to get MSE.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.