In the current code, SQ term is calculated as (line 236 in tbrmmdiagnostics.py)
sq = np.sqrt(phi * (n + 1) / (n * n_test * (n - 1)) + 1 / n + 1 / n_test)
Shall we write it as
sq = np.sqrt(phi * (n + n_test) / (n * n_test * (n - 1)) + 1 / n + 1 / n_test)
I think phi * (n + 1) / (n * n_test * (n - 1)) part is to estimate
$$\frac{(X_h - \bar{X})^2}{\sum (X_i - \bar{X})^2}$$
Which is $$\approx \frac{\sigma_x^2 (\frac{1}{n} + \frac{1}{n_{test}}) \chi^2(1)}{\sigma_x^2 \chi^2(n-1)} = F(1, n-1) \cdot \frac{\frac{n + n_{test}}{n \cdot n_{test}}}{n-1}$$
Not
$$F(1, n-1) \cdot \frac{\frac{n + 1}{n \cdot n_{test}}}{n-1}$$
In the current code, SQ term is calculated as (line 236 in tbrmmdiagnostics.py)
sq = np.sqrt(phi * (n + 1) / (n * n_test * (n - 1)) + 1 / n + 1 / n_test)Shall we write it as
sq = np.sqrt(phi * (n + n_test) / (n * n_test * (n - 1)) + 1 / n + 1 / n_test)I think
phi * (n + 1) / (n * n_test * (n - 1))part is to estimateWhich is$$\approx \frac{\sigma_x^2 (\frac{1}{n} + \frac{1}{n_{test}}) \chi^2(1)}{\sigma_x^2 \chi^2(n-1)} = F(1, n-1) \cdot \frac{\frac{n + n_{test}}{n \cdot n_{test}}}{n-1}$$
Not
$$F(1, n-1) \cdot \frac{\frac{n + 1}{n \cdot n_{test}}}{n-1}$$