Inverse Cumulative distribution function
6 ビュー (過去 30 日間)
古いコメントを表示
Hi,
if i have the following CDF :
F(X)=1/1+b(1+b-(1+b+qx/b))(1+x/b)^-q
How can I find x=inverse(F(x))
with my best reguards
0 件のコメント
採用された回答
Jeff Miller
2021 年 3 月 31 日
Suppose you have a function called thisCDF which computes the CDF for your distribution. Then define
function x = inverseF(p)
inverseFerr = @(x) thisCDF(x) - p;
x = fzero(inverseFerr,0.5); % replace 0.5 with a starting guess for x
end
Now
x = inverseF(0.5) % compute the median, etc
5 件のコメント
Jeff Miller
2021 年 4 月 6 日
I don't know what you are trying to compute so I can't say for sure whether your code is correct, but a few things make me suspect it is not correct:
- The CDF should reach 1 and not stabilize at 0.7. Maybe your CDF function is not correct (e.g., why does it start with 1/1+... which is the same as 1+....?). What distribution are you actually trying to work with?
- Your inverseF function does not call fzero so it is not getting x values with the cdf of u. Instead, it is computing the CDF of u.
その他の回答 (1 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!