I have a quarterly time series and test for stationarity with an augmented Dickey-Fuller test using R.
adf.test(myseries)
# returns
# Dickey-Fuller = -3.9828, Lag order = 4, p-value = 0.01272
# alternative hypothesis: stationary
so the H0 is rejected. I tried to validate this intuitively and regressed the same series on a linear trend.
x<- 104:1
fit.1<-lm(myseries~x)
summary(fit.1)
#returns
# x 0.024 1.31e-05 ***
Even though a simple linear model is not so appropriate here and the intercept is large (around 80), there seems to be a slight downwards trend over time, which is in line with my thoughts after looking at the initial data. So do I get the adf.test wrong or is the trend just to small to be discovered?
Besides I used
plot(stl(myseries,"per"))
and ended up with a graph which sidebars suggested that trend and remainder were the main components driving the data, while seasonal influence was negligible. I saw that stl()
uses Local Polynomial Regression Filtering and got a rough idea how that works (still I wonder why smoothed trends of Hadley's ggplot2 package looked that different even though it uses the same method by default).
So summing up I got: - adf finding no evidence for a trend - a slight downwards trends "detected" by eyeballing and the naive approach - loess decomposition stating that the trend has strong influence (by the relation of its bars in the plot)
So what can I learned from this? Probably I do have a terminology problem here, because the former two seem to address time trends while the latter address some other trend I cannot fully grasp yet. Maybe my question is just: Can you help me to understand the trend extracted by loess? And how is it related to smoothed / filtered stuff like HP-Filter or Kalman Smoothing (if there is a relationship and similarity does not only occur in my case)?
y
in your second code snippet? $\endgroup$