Skip to content

Instantly share code, notes, and snippets.

@pkgandhi
Created August 9, 2020 17:56
Show Gist options
  • Save pkgandhi/494df5ba13c5c506d92e33e50e05d5d8 to your computer and use it in GitHub Desktop.
Save pkgandhi/494df5ba13c5c506d92e33e50e05d5d8 to your computer and use it in GitHub Desktop.
Using PP test to check stationarity
# Loading the packages
import pandas as pd
import pmdarima
# Loading the dataset:
data = pd.read_csv('../AirPassengers.csv')
data = data.rename(columns = {'#Passengers':'Passengers'})
data = data.set_index('Month')
# Conducting PP test:
test = pmdarima.arima.PPTest() # You can choose alpha here, default = 0.05
test.should_diff(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment