Difference between two vector CDFs

I am struggling to work out how to derive the vector for Prob(A - B > 0) where A and B are CDFs of independent variables in vector form.
I thought going through each point in the CDF vectors and multiplying 1-CDF_B by CDF_A would give the correct result, but the resulting vector doesn't sum to 1.

6 件のコメント

Torsten
Torsten 2017 年 5 月 5 日
What do you mean by "vector for Prob(A-B>0)" ?
In my opinion, Prob(A-B>0) is a single value, not a vector.
Best wishes
Torsten.
Image Analyst
Image Analyst 2017 年 5 月 5 日
Can you attach plots of A and B. Are they curves that go from (0,0) to 1,1) and cross each other some number of times, or what? Help us help you.
Ulrik William Nash
Ulrik William Nash 2017 年 5 月 5 日
編集済み: Ulrik William Nash 2017 年 5 月 5 日
Here is a subplot showing (left) the PDFs and (right) CDF. These diagrams are have been generated by the values contained in four vectors.
My question is basically, how to I obtain (using MATLAB operations) another vector from the ones I have, which captures Prob(A > B)?
Torsten
Torsten 2017 年 5 月 5 日
編集済み: Torsten 2017 年 5 月 5 日
Multiply PDF-vector for A with CDF-vector for B, sum the products and multiply the result by the distance of the points on the x-axis (deltax).
(Follows directly from the formula below).
Note that Prob(A-B>0) is not a vector, but a scalar value.
Best wishes
Torsten.
Ulrik William Nash
Ulrik William Nash 2017 年 5 月 5 日
編集済み: Ulrik William Nash 2017 年 5 月 5 日
My apologies, Torsten. I haven't been very clear. What I am looking for is not a scalar, but the PDF or CDF for another random variable, let's call it C, which equals A - B. Then, when I have this vector, I can find A > B or equivalently, C > 0.
Torsten
Torsten 2017 年 5 月 5 日
編集済み: Torsten 2017 年 5 月 5 日
The CDF of C=A-B at a point z can be obtained as follows:
Multiply PDF-vector of A at points x_i with CDF-vector of B at points x_i-z, sum the products and multiply the result by the distance of the points x_i (deltax). Then take the negative of this value and add 1.
The exact formula can be derived as follows :
F_C(z)
= Prob(A-B<=z)
= integral_{x=-oo}^(x=+oo) Prob(A=x)*Prob(B>=x-z) dx
= integral_{x=-oo)^(x=+oo) f_A(x)*(1-F_B(x-z)) dx
= 1 - integral_{x=-oo}^{x=+oo} f_A(x)*F_B(x-z) dx
Maybe MATLAB's "conv" for the vectors f_A and F_B can automatically perform the task you are looking for, but I don't have the time to go into detail.
Best wishes
Torsten.

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

回答 (1 件)

Torsten
Torsten 2017 年 5 月 5 日
編集済み: Torsten 2017 年 5 月 5 日

0 投票

Prob(A>B)
= integral_{a=-oo}^{a=+oo} Prob(A=a)*Prob(B<a) da
= integral_{a=-oo}^{a=+oo} f_A(a)*F_B(a) da
= integral_{a=-oo}^{a=+oo} (dF_A(a)/da)*F_B(a) da
where f_A, f_B denote PDFs of A and B and F_A, F_B denote CDFs of A and B.
Best wishes
Torsten.

タグ

質問済み:

2017 年 5 月 5 日

編集済み:

2017 年 5 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by