Difference between two vector CDFs
1 次查看(过去 30 天)
显示 更早的评论
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
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!