# How to model a Stationary series with no dependence among values

#1

Hello…

While forecasting Time Series, there can be two possibilities:

a)_ A strictly stationary series with no dependence among the values. Here we can model the residuals as white noise._
b) A series with significant dependence among values. In this case we need to use some statistical models like ARIMA to forecast the data.

How we can identify a stationary series with no dependence among the values .
How we should move ahead on modelling in that case. An explanation with example will be helpful.

Thanks in anticipation.

#2

How can we identify a stationary series?

You can run this R code a few times, and see if you identify stationary or non-stationary series.

`par(mfrow=c(2,1)); x=round(rnorm(30,mean=0,sd=3)); y=cumsum(x); ts.plot(x,main="Stationary"); ts.plot(y,main="Non Stationary")`

#3

To identify a stationary series, you can adopt two methods:

1. By looking at the time series plot
For a stationary series, 3 conditions need to be satisfied
i) Constant mean
ii) Constant varaince
iii) Covariance between any two random time points should not be a function of time
The first two conditions you can visually check, by intersecting the plot at various points as blocks and checking whether the mean and variance between those two blocks is constant or not. If it is not you can directly say the series is not stationary

2.We have statistical tests
i) Adf test , Ho=Series is non-stationary
ii) PP test, Ho=Series is non stationary
iii)KPSS test, Ho=Series is stationary

Hope this helps

#4

Thanks for replying. My question was little different. I am eager to know, given that we know that a Time Series is stationary,** how we can identify that there is no dependence among the values** .
And, second part how to go ahead with modelling.
May be we have to model the residuals as white noise. How to model when there is no dependence among values ? An explanation with example in R or python will be helpful.

#5

Thanks for replying. I am eager to know that after we had identified a stationary series, how can we test that there is no dependence among values. How can we model the Time Series then.

#6

Hi Shan,

There are various ways to check the dependence among observations are performing the steps to make a series stationary. Easy ones are:

1. Using ACF plot:
• About 95% of the auto-correlations should fall within the upper and lower bounds
1. The portmantau test:
• Instead of checking for each value and seeing if 95% lie within limit, this test provides a single metric for checking the hypothesis of no dependence between observations.

You can also try:
3. The difference-sign test
4. The rank-test

Understanding these tests in detail require sufficient statistics background. Please go through section 1.6 “Testing the Estimated Noise Sequence” of the book ‘Introduction to Time Series and Forecasting’ by Brockwell and Davis. You should be able to find it easily.

Lets discuss further if you have questions.

Cheers!

#7

After confirming for the stationarity test , we check weather a series contains any information from its historical value. for this we have a test in r Box.test(TimeSeries) and same can be visualized by ACF plot.

#8

Hi…

Thanks for response. Have gone through your article on Mini Datahack. Crisp and informative.
Wondering , how ARIMA performed in that hack. Can you please share a model where ARIMA being used in that problem (R or python). I am eager to see the approach.

Thanks…

#9

Thanks Shan.

I’m actually thinking of doing an article on comparing ARIMA and XGBoost techniques on the Time Series problem. It might not be this week but maybe in coming couple of weeks.

Stay tuned!

Cheers!

#10

Hi…

Article comparing the two techniques is a nice area to research on. Will look forward to your article.

Meanwhile, I am stuck in XGBoost. In Anaconda distribution XGBoost is not pre installed.
Can you suggest how to install the XGBoost library. I am using Windows10, 64bit.
Tried to follow few links in Github but could not derive any meaningful result as those contained bugs
in the process.

If its difficult to install in windows, what are other options. A simple stepwise reference will be helpful.
Have tried few links on net but could not install it properly.
Viewing the past few hackathons, we can realise the importance of XGBoost in stable.
Simple stepwise guide, which had led to installation of XGBoost successfully will be helpful.

Thanks a lot…

#11

I’m using a Macbook Pro system with OS X. Not really sure about windows but I know people face issues. Have you tried this guide https://github.com/dmlc/xgboost/blob/master/doc/build.md from the Xgboost GitHub repository? I used the same and it worked on my Mac.

#12

will be eagerly waiting for your article.