From: Mario Florez Porras <mario.florez.porras@gmail.com>
To: gretl-users@lists.wfu.edu
Sent: Tuesday, August 30, 2016 4:36 PM
Subject: [Gretl-users] MLE Advanced

Anyone know how it is calculated the covariance matrix?

Here is Octave code which produces the same covariance values as gretl:

degrees_of_freedom = cases-predictors
coefficients = pinv(IV)*DV
estimates = IV*coefficients;
residuals = DV-estimates;
SSres = residuals'*residuals;
residual_variance = SSres/degrees_of_freedom;
N=IV'*IV;
Ni=inv(N);
covariance_matrix = Ni*residual_variance;