generate_ar1_series#
- causalpy.data.simulate_data.generate_ar1_series(n, phi=0.9, scale=1.0, initial=0.0)[source]#
Generate an AR(1) series
x[t] = phi * x[t - 1] + eta[t].- Parameters:
- Returns:
Series of length
n. Uses the global NumPy random stream.- Return type:
np.ndarray
Examples
>>> np.random.seed(42) >>> series = generate_ar1_series(n=10, phi=0.9, scale=0.5) >>> len(series) 10