library(fpp2)
library(caret)
library(urca)a-) We can see the noise more than 95 percent the of the AFC lags ranges limit. we can also observe that they may be some corrections between the variables.
b-) we see that when the number of significant correlation is the data and when this increase the critical values get smaller.
autoplot(ibmclose)ggtsdisplay(ibmclose) ACF showing strong correclation The data shows that its stationary differencing can stabilize and remove the trending on the time series
ggtsdisplay(usnetelec)ggtsdisplay(diff(usnetelec, 1))ggtsdisplay(usgdp)ggtsdisplay(diff(usgdp, 1))ggtsdisplay(mcopper)ggtsdisplay(diff(mcopper, 1))ggtsdisplay(enplanements)ggtsdisplay(diff(enplanements, 1))ggtsdisplay(visitors)ggtsdisplay(diff(visitors, 1))retaildata <- readxl::read_excel("retail.xlsx", skip=1)
myts <- ts(retaildata[,"A3349709X"],
frequency=12, start=c(1982,4))
autoplot(myts)ggtsdisplay(myts)diff_myts <- diff(BoxCox(myts,BoxCox.lambda(myts)), lag = 12)
ggtsdisplay(diff_myts)diff_myts %>% ur.kpss() %>% summary()##
## #######################
## # KPSS Unit Root Test #
## #######################
##
## Test is of type: mu with 5 lags.
##
## Value of test-statistic is: 0.2085
##
## Critical value for a significance level of:
## 10pct 5pct 2.5pct 1pct
## critical values 0.347 0.463 0.574 0.739
y <- ts(numeric(100))
e <- rnorm(100)
for(i in 2:100)
y[i] <- 0.6*y[i-1] + e[i]autoplot(y)y3 <- ts(numeric(100))
e <- rnorm(100)
for(i in 2:100)
y3[i] <- 0.6*e[i-1] + e[i]autoplot(y3)y4 <- ts(numeric(100))
e <- rnorm(100)
for(i in 2:100)
y4[i] <- 0.6*y4[i-1] + 0.6*e[i-1] + e[i]y5 <- ts(numeric(100))
e <- rnorm(100)
for(i in 2:100)
y5[i] <- -0.8*y5[i-1] + 0.3*e[i-1] + e[i]autoplot(y) +
geom_line() +
autolayer(y5)# a
autoplot(wmurders)BoxCox(wmurders,lambda = "auto") %>% diff() %>% diff() %>%
ggtsdisplay()# d
Arima(wmurders, lambda = "auto")## Series: wmurders
## ARIMA(0,0,0) with non-zero mean
## Box Cox transformation: lambda= -0.09529835
##
## Coefficients:
## mean
## 1.1284
## s.e. 0.0276
##
## sigma^2 estimated as 0.0426: log likelihood=9.25
## AIC=-14.5 AICc=-14.27 BIC=-10.49