1 function [v0,v1]=like2(dw,t,stretch)
2 % [v0,v1]=like2(dw,t,stretch)
4 % dw > 0 confidence, positive detection
5 % dw < 0 minus confidence, negative detection
6 % t time since fire arrival
7 % stretch time scale (hours)
9 % v0 value of the data likelihood
10 % v1 derivative dv0/dt
16 % get detection likelihood
17 % p0 = log likelihood of detection, max=log(1)=0
19 [p0,p1]=like1(one,t,stretch);
21 % scale so that max p0=log(max_like)
23 % p1 does not change, derivative of constant is zero
25 % find likelihood of non-detection from
26 % probability(yes) + probability(no)=1
29 % d(n0)/dt = d(log(1-exp(p0)))/dt
30 n1=-p1.*exp(p0)./(1-exp(p0));
32 v0 = dw.*p0.*(dw>0) - dw.*n0.*(dw<0);
33 v1 = dw.*p1.*(dw>0) - dw.*n1.*(dw<0);