function [L] = logl_res(b)
% The following is the restricted loglikelihood function.

global y x1 T

beta_0 = b(1);
beta_1 = b(2);
sigma_2 = b(3);

L=0 ;
for i = 1:T

    L = L - 0.5*log(2*pi) - 0.5*log(sigma_2^2) - 0.5*(y(i) - beta_0 - ...
        beta_1*x1(i))^2/sigma_2^2;

end

L = -L;

end

