mvncdf seems to be violating the additive property of integrals

6 ビュー (過去 30 日間)
Brian
Brian 2025 年 7 月 18 日
コメント済み: Brian 2025 年 7 月 19 日
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?

採用された回答

Torsten
Torsten 2025 年 7 月 18 日
編集済み: Torsten 2025 年 7 月 18 日
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 件のコメント
Brian
Brian 2025 年 7 月 19 日
Ah, rookie mistake by me. Thanks for pointing that out!

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

その他の回答 (0 件)

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by