# How to model a Time Series which has different nonstationary segments by ARIMA?

I had a monthly river temperature (408 values, separated 360 for modeling). Then I deseasonalized and transformed it to a normal time series by a plotting position technique. Now I need to fit an ARMA model to the time series which I got. These plots show the time series which I want to fit a model, ACF and PACF plots.

According to the results I tried fitting ARMA(2,0,0) and ARIMA(1,0,1) using arima(TS, c(2,0,0)) in R. but both models were very bad fit. For example, AR(2) results are like this (I just plotted a portion of results for a better view)

The only explanation that I can think of is this: the results of my KPSS test and ADF test is stationarity for whole data, but If I apply the test on the different portions of data (like last 50 or 70 values) it will result in nonstationarity. So, Is my conclusion correct? or there is something else wrong with my modeling? If I am right how can I model a time series which has different form of nonstationarity in different parts of the data? Thank you,

I attached the excel file of my time series in this link: time series data (csv)

Check how you de-season your data before detrending? The ACF looks like there might still be a trend because the data shows a slow decay.

Also try using Breusch–Godfrey test or Ljung Box Q test to check for randomness in the ACF graph

I would adjust the parameters on the AR term q because the PACF has points passing the 95% CI

You can check how well the model fits using AICc

Nice & transparent data... :-) There are strong 1st garmonic whith Period=12, ampl=6.4 and something else (noise & other...)

next jast got the residuals and fit sin-wave again...

• Welcome to the site @IvanKshnyasev. I wonder if this will be sufficiently self-explanatory to be useful for future readers, would you mind explicating this a bit? – gung - Reinstate Monica Dec 26 '13 at 3:54