text_plain_output_2.png application_vnd.jupyter.stderr_output_1.png image_output_1.png
from matplotlib.pylab import plt

from statsmodels.tsa import stattools

import numpy as np

import pandas as pd

f = pd.read_csv('../input/time-series-forecasting-with-yahoo-stock-price/yahoo_stock.csv')

grid = np.linspace(0, 720, 500)
noise = np.random.rand(500)
result_curve = noise

acf_result = stattools.acf(result_curve)

grid = np.linspace(0, 100, 1000)
sin5 = np.sin(grid)
result_curve = sin5

grid = np.linspace(0, 100, 100)
sin5 = np.sin(grid)
result_curve = sin5
acf_result = stattools.acf(result_curve, nlags=100)

acf_result = stattools.acf(f['Open'], nlags=1000)
plt.subplot(121)
plt.plot(acf_result)
plt.axhline(y=0, linestyle='--')
plt.axhline(y=-1.96 / np.sqrt(len(f['Open'])), linestyle='--')
plt.axhline(y=1.96 / np.sqrt(len(f['Open'])), linestyle='--')