I am trying to prepare my data for an ARIMA Forecasting. For this purpose, I first applied the BoxCox Transformation. In the next step, I want to test the stationarity.
For this, I first applied the adf.test(bc_ts). The result:
Augmented Dickey-Fuller Test
data: bc_ts
Dickey-Fuller = -6.2552, Lag order = 5, p-value =
0.01
alternative hypothesis: stationary
Augmented Dickey-Fuller Test
data: bc_ts
Dickey-Fuller = -6.2552, Lag order = 5, p-value =
0.01
alternative hypothesis: stationary
In the next step I wanted to validate this result with the kpss-test(bc_ts). However, the result was the following:
KPSS Test for Level Stationarity
data: bc_ts
KPSS Level = 1.5496, Truncation lag parameter = 4,
p-value = 0.01
Since these two results are contradictory to each other, I must, to my knowledge, apply a variance ratio test. I have tried this as follows: Auto.VR(bc_ts). But the result is the following:
$stat
[1] 107.1164
$sum
[1] 183.4568
Unfortunately, I do not know how to interpret this result. Do I have to make differentiation or not?
What packages did you use to implement the ADF and KPSS tests? It is important to realize that there are three variations of each test: one with no deterministic component (no intercept and no trend), one with an intercept only and then one with an intercept and a time trend. You need to implement the the tests such that they are both capturing the same thing.
in this example I used the tseries package. Well I read that aTSA does have these tests too. And in general there are a lot packages offering these tests. In your opinion, what is the test with the most stable solution? Which package do you think I should use?
Attached you will find a plot of my timeseries (normal and BoxCox() transformed)
Just wondering, if I use auto.arima() so get my model, do I even have to differentiate it in the end?
The series definitely looks stationary to me. Is the data sensitive? If not, can you share it? If you can, then just use the dput function. It will give you a code that can be used to reconstruct it. Just paste the code here and I'll take a look at it for you and get back to you.
Okay. Well, in the world of statistical testing, you should always stick with test results, which are in line with common sense. The series clearly revolves around a specific mean value and, therefore, appears stationary. I asked for the data because there may have been an issue with the way you implemented the KPSS test. So I wanted to try it myself, but please, do not share it as it is sensitive.
Is forecasting your main goal? If it is, then auto.arima() will perform everything for you and you will not have to do anything to the data (e.g. compute the first difference).
Yes, my main goal is to do Arima forecasting using auto.arima(). I wasn´t sure, if this function does it by itself. Does it as well do transformation? Like do I have to do BoxCos() before using it?
No, you do not have to do anything to the series before using auto.arima() in the forecast package. It will automatically try out many models and then choose the best one. Note that the function has many arguments and you can finetune it to your needs.