-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogitProb2.m
32 lines (32 loc) · 1.11 KB
/
logitProb2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function logitSuitability = logitProb2(roaddist,riverdist,bandist,urbandist,logistbetas,state_trans,types)
ini_state1 = state_trans;
nt = length(types);
[rows,cols] = size(roaddist);
dataP = zeros(1,rows*cols);
logitSuitability = zeros(nt,rows*cols);
for t = 1:nt
for i = 1:rows
for j = 1:cols
if ini_state1(i,j) > 0
ylab = (j-1)*rows+i;
index = find(types == ini_state1(i,j));
mina = index;
% maxb = index*nt;
%size(logistbetas)
mlbetas=logistbetas(:,mina);
xtrain = [1;roaddist(i,j);riverdist(i,j);bandist(i,j);urbandist(i,j)];
%urbandist(i,j);suburbandist(i,j);indusdist(i,j);;roaddens(i,j)
% mlbetas(:,t)'*xtrain
if t == index
dataP(ylab)=0.7;
elseif t == nt
dataP(ylab) = (1/(1+exp(-1*mlbetas'*xtrain)));
else
dataP(ylab) = 0;
end
end
end
end
logitSuitability(t,:) = dataP;
end
end