Data Science Asked by tkarahan on April 29, 2021
I have a timeseries data and I want to forecast it by applying ARIMA. After reading data, I decomposed it to analyze its components and get an idea whether it is stationary or not. It seems there is no seasonal component and a trend. Plots are as below:
I also applied Dickey-Fuller test to data and got 0.010293 p-value indicating that timeseries is stationary. Then I applied some transformations to improve test results and achived better stationarity. I applied log transoformation and after that I got 9.540976e-11 p-value. Then I applied differencing to log transformed data by 1 shift and got 2.253272e-27 p-value.
Because test results are not bad I moved to determine P, I, Q terms of the ARIMA model. I specified I term as 1, because shifting gave better test results. For P I used partial auto-correlation function and for Q I used auto-correlation function. Plots of them as below:
From these plots I pick P term of AR as 8 and Q term of MA 26. Simply I chose points in the x-axis where the y-axis is 0. I don’t know well the theory behind this rule of thumb, but I saw it is used in different notebooks and probably there is a problem. Because when I tried to fit my ARIMA model as below, I got an error:
model = ARIMA(ts_log, order=(8,1,26))
results = model.fit(disp=-1)
ValueError: The computed initial AR coefficients are not stationary
You should induce stationarity, choose a different model order, or you can
pass your own start_params.
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP