Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Matlab is calculating the standard deviation differently

Writer Matthew Barrera
$\begingroup$

I want to understand why Matlab is giving me a wrong answer when I ask for the standard deviation. For example, I was trying to get the standard deviation of this matrix:

It doesn't make sense, because the first column $[1;4;7]$ gives me $3$ and the standard deviation is $\sqrt6$. I stuck there and I didn't even try to calculate the other standard deviations. What is happening? is Matlab using another formula for standard deviation other than the classical one? or it's rounding the number $\sqrt6$ to $3$? I need help, thank you!

$\endgroup$ 4

1 Answer

$\begingroup$

Matlab uses the sample standard deviation. That is, it divides by $n-1$ rather than $n$ to estimate the variance, because this gives an unbiased estimator of the variance. Taking the square root then gives the sample standard deviation.

Unfortunately, an unbiased estimator of the variance does not lead to an unbiased estimator of the standard deviation.

$\endgroup$ 4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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