Azzera filtri
Azzera filtri

Calculate 2 standard deviations

35 visualizzazioni (ultimi 30 giorni)
Chris
Chris il 28 Ago 2011
Commentato: Thomas To il 20 Gen 2020
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));

Risposta accettata

Wayne King
Wayne King il 28 Ago 2011
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 Commenti
jay yawson
jay yawson il 17 Giu 2019
Hello Wayne King. In this case, how would you calculate the standard error of the mean?
Thomas To
Thomas To il 20 Gen 2020
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.

Accedi per commentare.

Più risposte (1)

bym
bym il 28 Ago 2011
that is correct

Categorie

Scopri di più su Signal Processing Toolbox in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by