필터 지우기
필터 지우기

Standard deviation of values with standard deviation

조회 수: 2 (최근 30일)
Andreas Passos
Andreas Passos 2021년 3월 3일
댓글: Andreas Passos 2021년 3월 4일
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

채택된 답변

the cyclist
the cyclist 2021년 3월 3일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by