Код: Выделить всё
steps = 10000
rho = 0.9
e = np.random.randn(steps)
y = [0]
# Possible to get rid of this loop?
for i in range(len(e)):
y.append(rho*y[i] + e[i])
https://en.wikipedia.org/wiki/Autoregressive_model
Подробнее здесь: https://stackoverflow.com/questions/666 ... hout-loops