function [L] = logl_dur(b)
% The following is the loglikelihood function for a duration model with an
% exponential distribution.
global x1 x2 T t
b1 = b(1);
b2 = b(2);
XB = (x1*b1 + x2*b2);
L = 0;
for i = 1:T
L = L + XB(i) - t(i)*exp(XB(i));
end
L = -L;
end