Hoping again to solicit some help from the knowledgeable members here, I thought I'd come to you with this question.

I'm asked to write a program in C that takes as input an X an Y matrix and performs gram-schmidt orthogonalization to get the beta coefficients, standard errors of the parameters, estimated value of \( \sigma ^2\) and the residual values for each observation.

I've gotten the gram-schmidt orthogonalization down and have managed to get the beta coefficients. However, I'm unsure of the standard errors. I know that I can get the standard errors by inverting the upper triangular matrix (from the orthogonalization procedure), but haven't been able to verify that they're just the diagonal values from this inverted matrix.

In addition, I don't know how to get \( \sigma ^2\) from this method yet. I'm also told that I should only orthogonalize the first p columns in order to get the residuals (which would be the last column). Not sure what this is referring to though.

Thanks.