Distribution of variance for a special standardization I am looking to find the distribution of a transformation of a variable following an autoregressive model of lag order 1. The transformation consists of standardizing the variable on a rolling basis.
Let's assume the random variable X follows an AR(1) process:

The distribution interest is that of Z which is a standardization of X using a rolling mean and a rolling standard deviation, for sake of simplicity assume 20 day rolling moments


The end goal is to find the distribution of Z. Due to the autocorrelation in X, Z ends up with a standard deviation higher than 1. I would like to know the relation between rho and the variance of Z.
I have solved for the expected value and found that it is equal to zero, as expected from the standardization, due to the expected value of Xbar is equal to the expected value of X:


What I have tried so far is using:

But that is where, I am stuck. How do I find the variance of Z?
If it is easier to use a rolling basis up to (t-1) then it is fine as well.
TIA
 A: Ok, it turns out that the solution is actually reasonably simple. The AR(1) expression is
$$x_t =\mu + \rho x_{t-1} + \epsilon_t$$
Step 1: We will try to find the distribution of $x_t$. If we unroll the expression for $x_t$ back in time $\infty$ steps, we get
$$x_t = \rho^{\infty}x_{-\infty}
+ \mu \sum_{i=0}^{\infty} \rho^i
+ \sum_{i=0}^{\infty} \rho^i \epsilon_i
$$
Under the assumption that your error is i.i.d gauusian, namely, $\epsilon \sim \mathcal{N}(0, \sigma^2)$ and assuming $\rho < 1$ we can use the geometric series sum formula and the expression for the sum of random normal variables to obtain
$$x_t
\sim \mathcal{N} (\mu_0, \sigma^2_0)
= \mathcal{N} \biggl(\frac{\mu}{1-\rho}, \frac{\sigma^2}{1-\rho^2} \biggr)$$
Step 2: We will try to find the distribution of $\bar{x}_t$. If we unroll the expression for $x_t$ back in time $k$ steps, we get
$$x_t = \mu \sum_{i=0}^{k-1} \rho^i + \sum_{i=0}^{k-1} \rho^i \epsilon_{t-i} + \rho^k x_{t-k}$$
Now, consider the expression for the mean
$$\bar{x}_t = \frac{1}{n}\sum_{i=0}^{n-1} x_{t-i}$$
We will unroll each summand as many times as necessary to reach $x_{t-n}$
$$\bar{x}_t
= \frac{\mu}{n} \sum_{k=0}^{n-1}\sum_{i=0}^{k}\rho^i
+ \frac{1}{n} \sum_{k=0}^{n-1}\sum_{i=0}^{k}\rho^i \epsilon_i
+ \rho^n x_{t-n}$$
$$\bar{x}_t
= \tilde{\mu}_k + \tilde{\epsilon}_{k, t} + \rho^n x_{t-n}$$
So $\tilde{\mu}_k$ is just a number. Again, you can use formula for sum of random normal variables to find that $\tilde{\epsilon}_k$ is normally distributed with mean $0$ and variance
$$\tilde{\sigma}^2_k = VAR(\tilde{\epsilon}_k) = \frac{\sigma^2}{n^2} \sum_{k=0}^{n-1}\sum_{i=0}^{k}\rho^{2i}$$
Finally, we can calculate the the distribution for $\bar{x}_t$ to be
$$\bar{x}_t \sim \mathcal{N}(\rho^n \mu_0 + \tilde{\mu}, \rho^{2n} \sigma_0^2 + \tilde{\sigma}^2) $$
If you take this distribution, subtract its mean and divide by its sample variance, you will obtain Student's t-distributied random variable. There is just one step remaining: the sample variance you have computed will be biased because of autoregression. An unbiased estimator must be computed for this purpose instead. The simplest solution is to compute the expected value of the variance you have proposed, find the difference to the actual variance, and thus find the correction. Maybe you can do it yourself? This post is already too long :D
