When I try to execute
StandardDeviation[{1}]
I get an error
StandardDeviation::shlen: "The argument {1} should have at least two elements"
But std of one element is 0, isn’t it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The standard deviation is commonly defined as the square-root of the unbiased estimator of the variance:
You can easily see that for a single sample,
N=1and you get0/0, which is undefined. Hence your standard deviation is undefined for a single sample in Mathematica.Now depending on your conventions, you might want to define a standard deviation for a single sample (either return
Nullor some value or0). Here’s an example that shows you how to define it for a single sample.