Answer:
Check the explanation
Step-by-step explanation:
acorr() is function in matplotlib module in python. acorr() in full meaning is Auto-Correlation function(). and it it generally used to find out Auto-Correlation of array of x element.
matplotlib.pyplot.acorr()
# Implementation acorr()
import matplotlib.pyplot as plt
import numpy as np
epsilon= np.random.randn(1000)
plt.title("Autocorrelation")
plt.acorr(epsilon, usevlines = True,
normed = True, maxlags =2,
lw = 3)
plt.grid(True)
plt.show()
also i have created the exmaple for both Auto as well as cross correlation as below
import matplotlib.pyplot as plt
import numpy as np
np.random.seed(10**3)
x, y = np.random.randn(2, 1000)
fig, [ax1, ax2] = plt.subplots(2, 1, sharex=True)
ax2.acorr(x, usevlines=True, normed=True, maxlags=50, lw=2)
ax2.grid(True)
ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True, lw=2)
ax1.grid(True)
plt.show()