0
$\begingroup$

I have 77 observations in my time series data which I obtained from the tsdl library in R. I have also reduced the time window. The data is quarterly average earnings.

library(tsdl)
data<-tsdl[[94]]
data2<-window(data,end=c(1975,1))
earn<-data2[,3]

time series

I have differenced the data twice and taken a power transformation which lambda equal to -0.03. After differencing, the Dickey-Fuller test has a test statistic of -6.61 and p-value = 0.01.

lam<-BoxCox.lambda(earn)
trans.earn<-BoxCox(earn, lambda = lam)

nsdiffs(earn)
ndiffs(earn)


trans<-diff(trans.earn, lag=4, differences = 1)
trans<-diff(trans, differences = 1)

I now need to fit AR, MA, ARMA, ARIMA and SARIMA models. Here are the ACF and PACF:

acf and pacf

There is a significant spike at lag 4 in the ACF and then at lag 4,6 and 116 in the PACF. I am new to time series and have been struggling with these plots for a while. What do these plots tell me? Is there still some seasonality in my data? What would the p and q be for AR(p) and MA(q) models?

The Ljung-Box Test statistic is 1.14 and has a p-value of 0.29, does this suggest that there is no dependence left in my data? I cannot fit ARMA models? The auto.arima suggest the following model: ARIMA(0,1,1)(0,1,1)[4]

$\endgroup$
6
  • 1
    $\begingroup$ The data does not seem to have a unit root, so you should not have differenced it even once. By differencing twice, you have quadrupled (I think) your error variance without gaining anything. $\endgroup$ Oct 14 at 7:54
  • $\begingroup$ An adf.test on the original data, adf.test(earn), has a test statistic of -0.07 and p-value of 0.99. This suggests that it has unit root? $\endgroup$
    – username97
    Oct 14 at 8:23
  • $\begingroup$ This interpretation is only correct if you have specified the test model correctly. You should first take care of the rather obvious deterministic trend in the data. Having adjusted for it, you would not see any evidence of a unit root anymore. $\endgroup$ Oct 14 at 8:27
  • $\begingroup$ As I understand, I have differenced once for the trend and then differenced again for the seasonality. The resulting time series does have unit root. $\endgroup$
    – username97
    Oct 14 at 8:47
  • 1
    $\begingroup$ @anemone19: you'd be served well to heed Richard Hardy's advice. Keep in mind that the first step in a univariate time series model like this is to remove the deterministic components: trend and seasonality and potentially to do a variance stabilizing transformation in order to obtain a stationary series; it is that resulting stationary series that you want to model and not the one that has all these components lumped together. $\endgroup$ Oct 14 at 9:56
0
$\begingroup$

To get a sense of the trend: plot(decompose(earn))

You can detrend like this plot(earn-decompose(earn)$trend) or for example if you think you have a linear trend like this plot(lm(earn~c(1:length(earn)))$res,type="l") or analogously for say a quadratic trend plot(lm(earn~c(1:length(earn))+c(1:length(earn))^2)$res,type="l")). Check for seasonality. Then apply a box-cox variance-stabilizing transformation like you did to the resultant series. You will thus have removed the deterministic components without differencing. Now you're ready to model the stochastic component of this process. To forecast your series, when you're done modeling the stochastic component of the process, you'll have to bring back the deterministic components so as to reassemble the full series. That being said, if you don't think the past trend will extend into the future, first-differencing as you did may be the better way to go.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.