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

📄 deriv_cum_logist.m

📁 The BNL toolbox is a set of Matlab functions for defining and estimating the parameters of a Bayesi
💻 M
字号:
function d=deriv_cum_logist(x)
%computes derivative of cumulative logistic function in x

%x is row cvector or matrix and does not contain column of zeros!!

s=size(x);
%if (s(2)==1 &&s(1)>1) error('use row vectors'),end
y=exp(x)./(1+exp(x));
yy=y.^2;
v=ones(1,s(2));

e1=eye(s(2));
t1=kron(v,y-yy).*(ones(s(1),1)*e1(:)');
e2=diag(v(1:end-1),1);
t2=kron(-y+yy,v).*(ones(s(1),1)*e2(:)');
%t2=zeros(size(t1));
d=t1+t2;
d=reshape(d',[s(2) s(2) s(1)]);
d=permute(d,[2 1 3]);

⌨️ 快捷键说明

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