File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,14 +99,12 @@ fn main() {
9999 println ! ( "Estimated beta coefficeints from pseudoinverse:\n {:?}" , b) ;
100100 // Having the pseudoinverse, we can now compute t-values as well.
101101 // Recall the variance-covariance matrix of the estimates of b is given by
102- // inv(x'*x). Recall also that pinv(x) = inv(x'*x)*x'. The pseudoinverse
103- // has the property that A * pinv(A) = I and also that pinv(A)' = pinv(A').
104- // Therefore we can write the following to get the variance-covariance
105- // matrix from the pseudoinverse:
106- // pinv(x)*pinv(x') = inv(x'*x)*x'*pinv(x')
107- // pinv(x)*pinv(x') = inv(x'*x)*I
108- // pinv(x)*pinv(x') = inv(x'*x)
109- // pinv(x)*pinv(x)' = inv(x'*x)
102+ // inv(x'*x). Since the inverse of x'*x is guaranteed to exist, it is true
103+ // that inv(x'*x) = pinv(x'*x). Then, using Greville's proof:
104+ // inv(x'*x) = pinv(x'*x) = pinv(x)*pinv(x') = pinv(x)*pinv(x)'
105+ // https://epubs.siam.org/doi/10.1137/1008107
106+ // The last step is true because the pseudoinverse operation commutes with
107+ // the complex conjugate (transpose).
110108 //
111109 // (Note also that we can compute the variance-covariance matrix directly
112110 // from the singular value decomposition as v*inv(s).^2*v')
You can’t perform that action at this time.
0 commit comments