Calculate the probability that correlated variable is above a threshold for k consecutive times

#1
Hi everybody,

I need some help with the following problem.

X Gaussian random variable i.i.d. X~N(0,1)

Y Gaussian random variable obtained from X with sliding moving window of N samples (N=100).

example of Matlab code:
X = randn(1,1e6) ;
Y = movmean(X,N,’Endpoints’,’discard’) ;

Calculate the probability that Y is above a certain threshold (th) for at least k consecutive times (k > 1)

Thank you for your help!