function hl = HL(a, T)
  hl = zeros(2,2);
  for i = 1: length(T)
    power = a(1) + a(2)*T(i);
    hl(1,1) = hl(1,1) - exp(power);
    hl(1,2) = hl(1,2) - T(i)*exp(power);
    hl(2,1) = hl(2,1) - T(i)*exp(power);
    hl(2,2) = hl(2,2) - T(i)^2 * exp(power);
  end
end
