July 2019
Beginner to intermediate
740 pages
16h 52m
English
We can use a lag plot to check for relationships among values at a given time to those a certain number of periods before that time; that is, we create a scatter plot of data[:-1] (all but the last entry) and data[1:] (from the second entry to the last one).
If our data is random, this plot will have no pattern. Let's test this with some random data generated with NumPy:
>>> from pandas.plotting import lag_plot>>> np.random.seed(0) # make this repeatable>>> lag_plot(pd.Series(np.random.random(size=200)))
The random data points don't indicate any pattern, just random noise:

With our stock data, we know that prices on a given day ...
Read now
Unlock full access