import pandas as pd import numpy as np import matplotlib.pyplot as plt from statsmodels.tsa.api import SimpleExpSmoothing df = pd.read_csv(‘/content/all_stocks_5yr.csv’) apple_df = df[df[“Name”] == “AAPL”].copy() apple_df[“date”] = pd.to_datetime(apple_df[“date”]) apple_df.sort_values(“date”, inplace=True) apple_df.set_index(“date”, inplace=True) apple_df = apple_df.asfreq(‘B’) apple_df[“close”] = apple_df[“close”].interpolate() apple_close = apple_df[“close”] plt.figure(figsize=(10, 4)) plt.plot(apple_close, label=”Apple Closing Price”, color=”black”) plt.title(“Apple Stock Closing Prices”) plt.xlabel(“Date”) plt.ylabel(“Price”) plt.legend() plt.grid(True) […]
PACF Partial Autocorrelation Function
In this Data Science article, we are going to take a look at the Partial Autocorrelation Function (PACF). We will go over the background and then look at plotting both non stationary and stationary data. If you want to watch a video based around this tutorial, it is embedded below. https://youtu.be/XstPVx78yi8 PACF Background The PACF […]
ACF Autocorrelation Function
In this Data Science lesson we are going to take a look the Autocorrelation Function. Often abbreviated as ACF it can let us know if our data is stationary or not. We will go over some of the background behind it and plot it with the help of Python. If you want to watch a […]
Box Cox Transformation Time Series
By utilizing a Box-Cox transformation on your time series data, you can help stabilize the variance, which is an important step in making data stationary. Once you apply the transformation you should also consider differencing which will be covered in this lesson. Pre Box-Cox Transform Post Box-Cox Transform One limitation to using the Box-Cox transformation […]