Let's say I build a Generalized Least Squares model. I follow the standard procedure and first estimate a LM model. Then I create an error-response covariance matrix based on the residuals of this model. Now I build an LM model again only this time I specify weights based on the error-response covariance matrix.
Now suppose I want to predict with the GLS model out-of-sample to test for model stability. I want to confirm that I can simply perform a prediction using the coefficients estimated by GLS and there is no need to furnish weights anymore (especially since in a prediction scenario where residuals are not available the error-response covariance matrix cannot be generated).
We proceed to score on test data with coefficients from the training data. (The dimension of the test data consists of a cross-section of N individuals and T observations.) We would like to produce consistent standard errors. Therefore, instead of calculating standard error of the estimate in the OLS fashion, we weight the residuals (see below) by a "GLS weights" vector:
OLS calc of SEE:
sqrt( sum( ( residuals from linear model ) ^ 2 ) ) / residualDegreeFreedom )
GLS calc of SEE:
sqrt( sum( ( residuals from linear model) ^ 2 * glsWeight ) ) / sum( glsWeight ) * length( glsWeight ) / residualDegreeFreedom )
"gls weight" is a vector calculated in the usual way as the inverse of the variance of the residuals of each cross-section at a date (i.e. a vector of length T). However, here I am using the residuals from the test data as opposed to the training data (indeed this is required otherwise the dimension of out-of-time residuals would not match the dimension of GLS weights vector).
What is counter-intuitive is that if I want to measure the SEE of the GLS model out-of-sample on one individual, I am required to score all individuals out of sample (otherwise constructing the GLS weights vector would be impossible since there is no variance of residuals).
Question is - Am I required to use the GLS weights when calculating the SEE out-of-sample, or can I simply use the OLS calculation of SEE?