I forgot the definition of X:
X
X[n_] := X[n] = RandomVariate[NormalDistribution[0, 2], n];
Thank you. Your code does not work at my PC, but later I'll remove all errors.