By : Camelia Cahya Masyithah | 5003231024
ARIMA (3,1,0)(0,1,3)^12
\[ y_t = y_{t-1} + y_{t-12} - y_{t-13} + \phi_1 z_{t-1} + \phi_2 z_{t-2} + \phi_3 z_{t-3} + a_t - \Theta_1 a_{t-12} - \Theta_2 a_{t-24} - \Theta_3 a_{t-36} \\ dimana, \\ z_{t-1} = y_{t-1} - y_{t-2} - y_{t-13} + y_{t-14} \\ z_{t-2} = y_{t-2} - y_{t-3} - y_{t-14} + y_{t-15} \\ z_{t-3} = y_{t-3} - y_{t-4} - y_{t-15} + y_{t-16} \]
library(tseries)
## Warning: package 'tseries' was built under R version 4.4.3
## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
library(forecast)
## Warning: package 'forecast' was built under R version 4.4.3
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.4.3
set.seed(123)
at <- rnorm(1000, mean = 0, sd = 2)
phi1 <- 0.5
phi2 <- -0.3
phi3 <- 0.2
theta1 <- 0.4
theta2 <- -0.2
theta3 <- 0.3
n <- length(at)
y <- numeric(n)
for (t in 37:n) {
wt <- (phi1 * (y[t-1] - y[t-2] - y[t-13] + y[t-14]) +
phi2 * (y[t-2] - y[t-3] - y[t-14] + y[t-15]) +
phi3 * (y[t-3] - y[t-4] - y[t-15] + y[t-16]) +
at[t] -
theta1 * at[t-12] -
theta2 * at[t-24] -
theta3 * at[t-36])
y[t] <- y[t-1] + y[t-12] - y[t-13] + wt
}
y <- y[-(1:100)]
ts.plot(y, main="Plot Sebelum Differencing")
par(mfrow=c(1,2))
acf(y, main="ACF Sebelum Differencing")
pacf(y, main="PACF Sebelum Differencing")
#par(mfrow=c(1,2))
ts.plot(diff(y,1), main="Plot Setelah Differencing Non-Seasonal")
acf(diff(y,1), lag.max = 50, main="ACF Setelah Differencing Non-Seasonal")
pacf(diff(y,1), lag.max = 50, main="PACF Setelah Differencing Non-Seasonal")
diff_seasonal <- diff(diff(y,1), lag = 12)
ts.plot(diff_seasonal)
#par(mfrow = c(1,2))
acf(diff_seasonal, lag.max = 50, main="ACF Setelah Differencing Seasonal")
pacf(diff_seasonal, lag.max = 50, main="PACF Setelah Differencing Seasonal")