Suppose I'm fitting a multiple linear model $y = \beta_0 + \beta_1 x_1 + \beta_2 x_2$ + .... My $n$ data vectors are arriving sequentially and I'm trying to get the $t$-statistic for the estimated regression coefficient of the intercept over the most recent $k \ll n$ data points, $\frac{\hat{\beta_i}}{SE_{\hat{\beta_i}}}$ in the most efficient manner.
I found an online algorithm to estimate $\hat{\beta_i}$ over the sliding window of $k$ feature vectors, so this generalizes to the intercept.
What remains is an efficient way to compute only the diagonal element corresponding to the intercept in $\hat{\sigma}^2\left(X^TX\right)^{-1}$. Is it possible to do this online?
This seems nontrivial. Since my regression model and hence in-sample predictions are changing with each data point, I'll need to iterate over all $k$ points to compute the variance of the residuals. But I'm guessing that at least $\left(X^TX\right)^{-1}$ is well-studied so there must be some literature to compute it online over a sliding window.