How to calculate the confidence interval from distributions overlap

5 Ansichten (letzte 30 Tage)
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 Kommentare
Yassine
Yassine am 12 Mär. 2021
Bearbeitet: Yassine am 12 Mär. 2021
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 am 12 Mär. 2021
> 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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Adam Danz
Adam Danz am 12 Mär. 2021
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 Kommentare
Adam Danz
Adam Danz am 12 Mär. 2021
Bearbeitet: Adam Danz am 13 Mär. 2021
How are your curves generated? They aren't normal distributions (amplitudes are ~100). Try cdf() or ecdf() functions.
Yassine
Yassine am 13 Mär. 2021
I fitted normal distributions and it worked with normcdf. Thanks!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Jeff Miller
Jeff Miller am 12 Mär. 2021
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