How to calculate the confidence interval from distributions overlap

7 ビュー (過去 30 日間)
Yassine
Yassine 2021 年 3 月 12 日
編集済み: Adam Danz 2021 年 3 月 13 日
I am trying to compute the confidence interval between the distribution in blue (baseline) and the distribution in orange, which is updated with a moving window every time a new sample comes in. The confidence interval is how much area of the orange distribution lies below mu+3*sigma of the baseline (the vertical line).
Assuming that the 2 distributions have the same standard deviation, how to compute the area of the orange distribution to the left of the vertical line?
  3 件のコメント
Yassine
Yassine 2021 年 3 月 12 日
編集済み: Yassine 2021 年 3 月 12 日
Actually it's the confidence interval that a new measurement falls within the normal behavior area which has a limit at 3 sigma of the mean of the blue distribution. That means that if I have a complete overlap of the 2 distributions, I'm a 100% confident that the measurement is within normal. If the mean of the orange distribution is at the vertical line, I'm 50% confident and if the orange distribution is completely to the right of the vertical line, I'm 100% confident that the measurement is out of normal.
Adam Danz
Adam Danz 2021 年 3 月 12 日
> If the mean of the orange distribution is at the vertical line, I'm 50% confident [that the measurement is within normal].
Really? So if the mean of the orange data is centered on +3std of the blue mean, you're 50% certain that the two distributions are from the same population? That doesn't sound OK to me. +3 std is far from the mean and is often considered an outlier.

サインインしてコメントする。

採用された回答

Adam Danz
Adam Danz 2021 年 3 月 12 日
It sounds like what you're looking for is to find the number of standard deviations between the mean of the orange distribution and the 3rd std of the blue distribution (the vertical line) which would be
nSTD = ((mean(blue)+3*std(blue)) - mean(orange)) / std(orange);
where negative values of nSTD means the mean of the orange distribution is to the right of the 3rd std of the blue distribution, 0 means the orange mean is on the blue 3rd std. If nSTD==3 that means the curves are on top of eachother.
  3 件のコメント
Adam Danz
Adam Danz 2021 年 3 月 12 日
編集済み: Adam Danz 2021 年 3 月 13 日
How are your curves generated? They aren't normal distributions (amplitudes are ~100). Try cdf() or ecdf() functions.
Yassine
Yassine 2021 年 3 月 13 日
I fitted normal distributions and it worked with normcdf. Thanks!

サインインしてコメントする。

その他の回答 (1 件)

Jeff Miller
Jeff Miller 2021 年 3 月 12 日
I wouldn't call this a confidence interval either, but I think you can compute the shaded area probability like this:
% Values assumed or known them from elsewhere:
% I am guessing them from the figure--change them as appropriate:
blueCutoff = 0.0475;
sigma = 0.005;
orangeMean = 0.045;
% With those values, compute
zCutoff = (blueCutoff - orangeMean) / sigma;
p = normcdf(zCutoff); % this is the probability of the shaded area

Community Treasure Hunt

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

Start Hunting!

Translated by