Calculate 2 standard deviations

조회 수: 44 (최근 30일)
Chris
Chris 2011년 8월 28일
댓글: Thomas To 2020년 1월 20일
I am trying to calculate +/- two standard deviations from the mean of a bunch of values. I am not sure if I am using the standard deviation function properly. Would I just multiply by two to get 2 standard deviations?
dmean = mean(values(:,1)); upperstd = dmean+2*std(values(:,1)); lowerstd = dmean-2*std(values(:,1));

채택된 답변

Wayne King
Wayne King 2011년 8월 28일
Hi Chris, for a matrix of data
x = randn(10,4);
mean(x)+2*std(x)
mean(x)-2*std(x)
gives the sample means of the columns plus/minus 2 times the standard deviation. The question is whether you really want the sample standard deviation here, or the standard error of the mean.
Wayne
  댓글 수: 2
jay yawson
jay yawson 2019년 6월 17일
Hello Wayne King. In this case, how would you calculate the standard error of the mean?
Thomas To
Thomas To 2020년 1월 20일
Jay, the standard error is calculated by taking the standard deviation and dividing it by the square root of N-th samples used to calculate the standard deviation.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

bym
bym 2011년 8월 28일
that is correct

카테고리

Help CenterFile Exchange에서 Signal Processing Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by