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

Variance Calculation is wrong #3

Open
Genie-Liu opened this issue Mar 1, 2023 · 1 comment
Open

Variance Calculation is wrong #3

Genie-Liu opened this issue Mar 1, 2023 · 1 comment

Comments

@Genie-Liu
Copy link

private static double getVar(double sxx, double sx, int n) {
return (sxx - sx * sx / n) / (n - 1);
}

I think it should be

 private static double getVar(double sxx, double sx, int n) { 
   return (sxx - sx * sx * n) / (n - 1); 
 } 
@DelightRun
Copy link

No, your function is wrong, the author's version is correct.

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

No branches or pull requests

2 participants