function [L] = logl_unres(b)
% The following is the unrestricted loglikelihood function.
global y x1 x2 T

beta0 = b(1);
beta1 = b(2);
beta2 = b(3);
sigma = b(4);

L=0 ;

for i = 1:T

    L = L - 0.5*log(2*pi) - 0.5*log(sigma^2) - 0.5*(y(i) - beta0 - ...
                                      beta1*x1(i) - beta2*x2(i))^2/sigma^2;

end

L = -L;

end

