How to derive a CDF from a given PDF?
5 ビュー (過去 30 日間)
古いコメントを表示
Here is the pdf fucntion: skn = 2.*(1/sqrt(2*pi)).*exp(-0.5*x.^2).*normcdf(a.*x,0,1); How can I define a CDF function from it? Also, after I have CDF, How can I find inverse of that CDF? Thanks.
0 件のコメント
回答 (1 件)
Tom Lane
2012 年 11 月 9 日
If you have the Symbolic Toolbox, you might try replacing normcdf by an erf function and see what you get.
Otherwise you could try something like this:
x = linspace(-5,5);
a = pi;
f = @(x) 2.*(1/sqrt(2*pi)).*exp(-0.5*x.^2).*normcdf(a.*x,0,1);
F = zeros(size(x));
for j=1:length(x)
F(j) = integral(f,-Inf,x(j));
end
plot(x,F)
For the inverse cdf, you might try interpolating or using fzero.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!