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

📄 deriv_adj_logist.m

📁 The BNL toolbox is a set of Matlab functions for defining and estimating the parameters of a Bayesi
💻 M
字号:
function d=deriv_adj_logist(x)
%computes derivative of adj logistic function in x
%see Bischop C p.217
%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=adj_logistic([zeros(size(x,1),1) x]); %add column of zeros for multinom_logistic
y(:,1)=[]; %remove first column again
v=ones(1,s(2));
yy=zeros(s);
for i=1:s(2)
    yy(:,i)=sum(y(:,i:s(2)),2);
end
%e=eye(s(2));
tr=tril(ones(s(2)));
t1=kron(v,y).*(ones(s(1),1)*tr(:)');
t2=kron(v,y).*kron(yy,v);
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 + -