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

📄 cum_logistic.m

📁 The BNL toolbox is a set of Matlab functions for defining and estimating the parameters of a Bayesi
💻 M
字号:
function y=cum_logistic(x)
%y=cum_logistic(x) computes probabilities for cumulative logistic function
%for nd arrays, sum over dimension nd
%if only one vector, use row vector!



z=exp(x)./(1+exp(x));

siz=size(z);
shift=prod(siz(1:end-1));
y=zeros(shift,siz(end));
z=reshape(z,shift,siz(end));

y(:,end)=z(:,end);
for i=2:siz(end)-1
    y(:,i)=z(:,i)-z(:,i+1);
end
y(:,1)=1-sum(y,2);
if ~isvector(z)
    y=reshape(y,[siz(1:end-1) siz(end)]);
end


⌨️ 快捷键说明

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