📄 calpdf.m
字号:
function pp=CalPdf(x, mui, smgi, c3i, c4i, c5i, c6i, c7i, c8i, c9i)
% calculate probability of a specific value
x1=(x-mui)/smgi;
ei=2.7183;
e1=ei^(-x1^2.0/2);
s1=1.0/sqrt(2*pi);
% cdf
b0=normcdf(x1,0,1);
% pdf
b1=s1*e1;
% 1th
b2=-x1*s1*e1;
% 2th
b3=(x1^2-1)*s1*e1;
% 3th
b4=(3*x1-x1^3)*s1*e1;
% 4th
b5=(3-6*x1^2+x1^4)*s1*e1;
% 5th
b6=(-15*x1+10*x1^3-x1^5)*s1*e1;
% 6th
b7=(-15+45*x1^2-15*x1^4+x1^6)*s1*e1;
% 7th
b8=(-x1^7+21*x1^5-105*x1^3+105*x1)*s1*e1;
% 8th
b9=(x1^8-28*x1^6+210*x1^4-420*x1^2+105)*s1*e1;
% 9th
b10=(-x1^9+36*x1^7-378*x1^5+1224*x1^3-945*x1)*s1*e1;
pp=b1+c3i*b4/6+c4i*b5/24+c5i*b6/120+c6i*b7/720*c7i*b8/5040+c8i*b9/40320+c9i*b10/362880;
;
return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -