Regression Equations, Generalized Least Squares, Correlation Matrices, Python, Statsmodels.
(Image by Author) Lets perform this calculation: E=np.array(df_OLS_resid) S=(1/N)*np.matmul(np.transpose(E), E) We’ll now calculate an estimate of Ω as the Kronecker product of S and I where I is an Identity matrix of size [N x N]. I = np.identity(N) estimated_omega = np.kron(S, I) We can now use