Last chance! 50% off unlimited learning
Sale ends in
arima
, a R built-in function.
Variance change in time series is an important topic.
In some cases using a Box-Cox transformation will provide a much simpler
analysis than the much more complex ARMA-GARCH approach.
See US Tobacco series example given below for an example.
"BoxCox"(object, interval = c(-1, 1), type = "BoxCox", InitLambda = "none", ...)
For $lambda!=0$, the Box-Cox transformation is of x is $(x^lambda-1)/lambda$. If the minimum data value is <= 0,="" a="" small="" positive="" constant,="" equal="" to="" the="" negative="" of="" minimum="" plus="" 0.25,="" is="" added="" all="" data="" values.<="" p="">
The log of the Jacobian is $ (lambda-1)*sum(log(z[(D+1):n])$, where $lambda$ is the transformation, n=length(z), z is the vector of data and D = d + ds*s, where d is the degree of regular differencing, ds is the degree of seasonal differencing and s is the seasonal period. The correct expression for the loglikelihood function was first given in Hipel and McLeod (1977, eqn. 10). Using the wrong expression for the Jacobian has a disasterous effect in many situations. For example with the international airline passenger time series, the MLE for lambda would be about 1.958 instead of close to zero.
If the minimum data value is <= 0,="" a="" small="" positive="" constant,="" equal="" to="" the="" negative="" of="" minimum="" plus="" 0.25,="" is="" added="" all="" data="" values.<="" p="">
arima
,
BoxCox
,
BoxCox.FitAR
## Not run: #not run to save time!
# #Tobacco Production
# plot(USTobacco)
# USTobacco.arima<-arima(USTobacco,order=c(0,1,1))
# BoxCox(USTobacco.arima)
# #
# air.arima<-arima(AirPassengers, c(0,1,1), seasonal=list(order=c(0,1,1), period=12))
# BoxCox(air.arima)
# #
# #In this example, we fit a model to the square-root of the sunspots and
# #back transform in BoxCox.
# sqrtsun.arima<-arima(sqrt(sunspot.year),c(2,0,0))
# BoxCox(sqrtsun.arima, InitLambda=0.5, type="power")
# #
# #Back transform with AirPassengers
# Garima<-arima(log(AirPassengers), c(0,1,1), seasonal=list(order=c(0,1,1),period=12))
# BoxCox(Garima, InitLambda=0)
# ## End(Not run)
Run the code above in your browser using DataLab