Question: #Please Answer in python Codeblock #2 Examining the Data A) To start, check the stationarity of the data by plotting the rolling mean and standard

#Please Answer in python Codeblock

#2 Examining the Data

#Please Answer in python Codeblock #2 Examining the Data A) To start,

A)

To start, check the stationarity of the data by plotting the rolling mean and standard deviation alongside the data itself.

Based on your plot, is the data stationary? Provide reasons with your answes. Include your answer either as a text cell or in-line comment.

B)

Use seasonal_decompose to observe the trend, seasonality, and residuals for the data by plotting all plots alongside one another.

Based on your plots, is there a cyclical pattern in the data? Provide reasons with your answers. Include your answer either as a text cell or in-line comment.

C)

To further confirm stationarity or non-stationarity, perform the Dickey-Fuller Test on the data. You may use the run_adftest method provided in lecture (below).

from statsmodels.tsa.stattools import adfuller

def run_adftest(s): print("Dickey-Fuller Test") adftest = adfuller(s, autolag='AIC') print(f"Test Statistic: {adftest[0]}") print(f"p-value: {adftest[1]}") print("Critical Values:") for k, v in adftest[4].items(): print("\t{}: {} - The data is{} stationary with {}% confidence".format(k, v, " not" if v

run_adftest(series['IOP'])

**IOP can be replaces with series of interest

Based on the result, is any differencing needed? If so, first-order difference the data and re-run the Dickey-Fuller Test to see if the results change.

Production Volume B 1 Date IOP 2 1995 JAN 89.9 3 1995 FEB 93.3 4 1995 MAR 108.2 5 1995 APR 91 6 1995 MAY 101.2 7 1995 JUN 101.4 8 1995 JUL 95 9 1995 AUG 95.3 10 1995 SEP 101.4 11 1995 OCT 107.4 12 1995 NOV 109 13 1995 DEC 92.7 14 1996 JAN 96.1 15 1996 FEB 97.2 16 1996 MAR 103.6 17 1996 APR 95.8 18 1996 MAY 100.1 19 1996 JUN 97.8 20 1996 JUL 99.4 21 1996 AUG 90.6 22 1996 SEP 100.8 23 1996 OCT 109.9 24 1996 NOV 104.6 25 1996 DEC 95 26 1997 JAN 97.2 27 1997 FEB 97.1 Production Volume B 1 Date IOP 2 1995 JAN 89.9 3 1995 FEB 93.3 4 1995 MAR 108.2 5 1995 APR 91 6 1995 MAY 101.2 7 1995 JUN 101.4 8 1995 JUL 95 9 1995 AUG 95.3 10 1995 SEP 101.4 11 1995 OCT 107.4 12 1995 NOV 109 13 1995 DEC 92.7 14 1996 JAN 96.1 15 1996 FEB 97.2 16 1996 MAR 103.6 17 1996 APR 95.8 18 1996 MAY 100.1 19 1996 JUN 97.8 20 1996 JUL 99.4 21 1996 AUG 90.6 22 1996 SEP 100.8 23 1996 OCT 109.9 24 1996 NOV 104.6 25 1996 DEC 95 26 1997 JAN 97.2 27 1997 FEB 97.1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!