How to derive a CDF from a given PDF?

5 ビュー (過去 30 日間)
Zheng
Zheng 2012 年 11 月 8 日
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.

回答 (1 件)

Tom Lane
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.

カテゴリ

Help Center および File ExchangeDesign of Experiments (DOE) についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by