How to integrate a distribution function for a specific interval?
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
I computed two distribution function:
[distribution_1,x]=ecdf(X); Distribution_2= f(distribution_1);
Now I want to integrate Distribution_2 over the interval [a,b] and tried to use q = integral(fun,xmin,xmax) but I have trouble creating the function handle "fun" in my specific case (since I cannot create the connection to x?)
Thankful for any advice!
5 件のコメント
Robert
2017 年 11 月 6 日
What does the function f do?
Nina
2017 年 11 月 6 日
Robert
2017 年 11 月 6 日
Is Distribution_2 also a CDF? Just to be clear, are you trying to integrate the CDF or integrate the corresponding PDF (which you could do by differencing two points on the CDF).
Nina
2017 年 11 月 6 日
Nina
2017 年 11 月 6 日
採用された回答
その他の回答 (1 件)
David Goodmanson
2017 年 11 月 6 日
編集済み: David Goodmanson
2017 年 11 月 6 日
Hi Nina,
If this is not a misinterpretation of the problem, then it seems to work. I am assuming that the function ecdf is already on the Matlab path.
g = .1; h = .2;
fun = @(x) 1-(1-ecdf(x).^(1/(1+g))).^(1+h)
integral(@(x) fun(x), 2,3)
function a = ecdf(x) % for demo purposes
a = sin(x);
end
I'm curious about the idea of integrating a cdf, could you perhaps comment on that?
1 件のコメント
Nina
2017 年 11 月 7 日
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!