Speed-up inverse calculation of weighted least squares mean estimate in R
问题 I need to speed up the calculation of the mean estimate of beta in a WLS in R - I was able to speed up the covariance calculation thanks to SO, and now I am wondering if there is another trick to also speed up the mean calculation (or if what I am doing is already efficient enough). n = 10000 y = rnorm(n, 3, 0.4) X = matrix(c(rnorm(n,1,2), sample(c(1,-1), n, replace = TRUE), rnorm(n,2,0.5)), nrow = n, ncol = 3) Q = diag(rnorm(n, 1.5, 0.3)) wls.cov.matrix = crossprod(X / sqrt(diag(Q))) Q.inv =