nalgebra icon indicating copy to clipboard operation
nalgebra copied to clipboard

Documentation does not specify if variance is population or sample

Open wjholden opened this issue 1 year ago • 1 comments

Hello, just a small suggestion here to specify in the documentation that Matrix::variance is calculating the population variance and not the sample variance. Coming from an R background, I was surprised when Matrix::row_variance didn't return the same values as R's var.

Simply changing the doc comment from "The variance of all the elements of this matrix" to "The population variance of all the elements of this matrix" might have helped my confusion.

wjholden avatar Feb 11 '25 07:02 wjholden

https://github.com/dimforge/nalgebra/blob/a3c261051ba7c8201ef8c49640ae24c1f53360f7/src/base/statistics.rs#L343

wjholden avatar Feb 11 '25 07:02 wjholden