How can I get function expression for Cumulative distribution function
古いコメントを表示
I have a cumulative distribution function(cdf). I have attached the figure. How can I fit the curve and get the function

expression for it?
採用された回答
その他の回答 (1 件)
Miley Lee
2019 年 7 月 30 日
0 投票
1 件のコメント
Star Strider
2019 年 7 月 30 日
Specifically:
x = randn(1, 25)*2 + 5; % Create Data
x = sort(x);
[mu,sigma] = normfit(x);
d=cdf('norm',x,mu,sigma);
figure
plot(x,d)
I did not initially provide the ‘x’ vector, since you have your own. I created it to test my code, and include it here for completeness. (The sort function sorts ascending by default, so there is no need to specify it.)
An alternative using the erf function is:
x = randn(1, 25)*2 + 5; % Create Data
x = sort(x);
[mu,sigma] = normfit(x);
p = @(x,mu,sigma) (1 + erf((x-mu)/(sigma*sqrt(2))))/2; % Equivalent to ‘normcdf’
figure
plot(x,p(x,mu,sigma))
カテゴリ
ヘルプ センター および File Exchange で Half-Normal Distribution についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

