Merge branch 'femwind' of github.com:janmandel/wrf-fire-matlab into femwind
[wrf-fire-matlab.git] / detection / like_test.m
blobe0bd1bf54397fd6ed918b3c2b5e9be24d1867ee7
1 function like_test(like)
2 stretch=[0.5,10,5,10];
3 t=[-10:0.01:30];
4 [p0,p1]=like(1,t,stretch);
5 [nn0,nn1]=like(-1,t,stretch);
6 n0 = log(1-exp(p0));          % exp(p0) + exp(n0)=1;
7 n1 = -exp(p0).*p1 ./exp(n0); % exp(p0)*p1 + exp(n0)*n1=0;
8 err0=big(n0-p0), err1=big(n1-p1)
9 [n0,n1]=like(-1,t,stretch);
10 % figure(1),clf
11 figure
12 plot(t,p0,'-',t,n0,'--');
13 xlabel('Time since fire arrival (h)')
14 ylabel('Log probability')
15 legend('Fire detected','Land/water no fire')
16 grid on
17 figure
18 % figure(2),clf
19 plot(t,p1,t,n1)
20 grid on