mvncdf seems to be violating the additive property of integrals

6 vues (au cours des 30 derniers jours)
Brian
Brian le 18 Juil 2025
Commenté : Brian le 19 Juil 2025
I need to determine the probability of an event ocurring in a subset of an experiment sample space comprised of two random continuous variables. When I use mvncdf to evaluate the whole sample space, I get the expected result of 1. However, when I partition the sample space into two pieces and use mvndcf to evaluate probabilities like before, the sum of the respective probabilities is significantly smaller than 1.
%% CODE:
% Define Integration Limits
Low_Lim = -inf(1,2);
Med_Lim = [-0.1836 4.1085];
High_Lim = inf(1,2);
% Define bivariate curve properties
mu = [-0.2020 4.5194];
covar = [0.2940 0.2027
0.2027 0.1434];
Fraction_1 = mvncdf(Low_Lim,Med_Lim,mu,covar) % yields 0.1390
Fraction_2 = mvncdf(Med_Lim,High_Lim,mu,covar) % yields 0.4865
Fraction_1 + Fraction_2 % yields 0.6255, uh oh, this should be 1
% Check that mvncdf works over the whole sample space
Fraction_whole = mvncdf(Low_Lim,High_Lim,mu,covar) % yields 1, as expected
%% END OF CODE
What am I doing incorrectly that results in Fraction_1 + Fraction_2 < 1?

Réponse acceptée

Torsten
Torsten le 18 Juil 2025
Modifié(e) : Torsten le 18 Juil 2025
The complete IR^2 is made up of four quarter zones, not two. Sketch the quarter zones over which you integrate to understand what's going on.
%% CODE:
% Define Integration Limits
Low_Lim = -inf(1,2);
Med_Lim = [-0.1836 4.1085];
High_Lim = inf(1,2);
% Define bivariate curve properties
mu = [-0.2020 4.5194];
covar = [0.2940 0.2027
0.2027 0.1434];
Fraction_1 = mvncdf(Low_Lim,Med_Lim,mu,covar)
Fraction_1 = 0.1389
Fraction_2 = mvncdf(Med_Lim,High_Lim,mu,covar)
Fraction_2 = 0.4865
Fraction_3 = mvncdf([Low_Lim(1),Med_Lim(2)],[Med_Lim(1),High_Lim(1)],mu,covar)
Fraction_3 = 0.3746
Fraction_4 = mvncdf([Med_Lim(1),Low_Lim(1)],[High_Lim(1),Med_Lim(2)],mu,covar)
Fraction_4 = 1.0242e-14
Fraction_1 + Fraction_2 + Fraction_3 + Fraction_4
ans = 1
  1 commentaire
Brian
Brian le 19 Juil 2025
Ah, rookie mistake by me. Thanks for pointing that out!

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by