Standard deviation of values with standard deviation

2 visualizaciones (últimos 30 días)
Andreas Passos
Andreas Passos el 3 de Mzo. de 2021
Comentada: Andreas Passos el 4 de Mzo. de 2021
Hello,
Let's say I have the follwing sample (the error values correspond to the std) :
10 +- 1
15 +- 2
20 +- 3
I want to calculate the average value and the standard deviation. The mean of the [10,15,20] is 15 with std = 4.1 disregarding the individual stds.
How would I calculate the average of the sample and the std taking inti account the individual stds??
Thank you,
Andreas

Respuesta aceptada

the cyclist
the cyclist el 3 de Mzo. de 2021
The question you are asking is a specific instance of "propagation of uncertainty". You might want to learn more about the topic.
For this specific case, I believe the answer is
std_sum = sqrt(1^2 + 2^2 + 3^2); % error of sum = square root of (sum of squares of individual uncertainties)
std_mean = std_sum/3
std_mean = 1.2472
Here is a simulation that suggests that this is correct:
rng default
N = 100000;
x1 = 10 + 1*randn(N,1);
x2 = 15 + 2*randn(N,1);
x3 = 20 + 3*randn(N,1);
x = [x1, x2, x3];
mean_x = mean(x,2);
mean(mean_x)
ans = 15.0007
std(mean_x,1)
ans = 1.2459
figure
subplot(4,1,1), histogram(x(:,1))
xlim([0 30])
subplot(4,1,2), histogram(x(:,2))
xlim([0 30])
subplot(4,1,3), histogram(x(:,3))
xlim([0 30])
subplot(4,1,4), histogram(mean_x)
xlim([0 30])
I would encourage you to be really careful about your terminology. Often when people write x +/- dx, dx refers to the standard error, not the standard deviation. The standard deviation is a property of the parent population. The standard error (of the mean, for example) will depend on the sampling -- specifically on sample size.
I think that what I have written above probably corresponds to what you wanted to know, but be careful.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by