⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qinv.m

📁 这是在网上下的一个东东
💻 M
字号:
%%  qinv=qinv(y,a,u,beta)%%  This function computes the inverse of the posterior CDF.  It us used%  by gensol.%function qinv=qinv(y,a,u,beta)% if a = 0, use the limitif (abs(a) < eps*10^8)	qinv=u*y;% if beta << -1, use the asymptotic approximationelseif (beta < -300)	term1=log(y*a^2*(3*beta-a)/(-6*beta^3)+exp(-a/beta));	mnew=u;	stopcrit=1;	while stopcrit > eps*10^8		mold=mnew;		fofx=log(a*(mold+1/a-u-1/beta))+a*(u-mold)-term1;		fprime=-a+1/(mold+1/a-u-1/beta);		mnew=mold-fofx/fprime;		stopcrit=abs((mold-mnew)/mold);	end	qinv=mnew;else	qinv=-log(1-y+y*exp(-a*u))/a;end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -