\[ \Phi_4(B^{12})(1-B)(1-B^{12})y_t = \theta_4(B)\Theta_4(B^{12})a_t \]
\[ (1 - \Phi_1 B^{12} - \Phi_2 B^{24} - \Phi_3 B^{36} - \Phi_4 B^{48})(1-B)(1-B^{12})y_t = (1 + \theta_1 B + \theta_2 B^2 + \theta_3 B^3 + \theta_4 B^4)(1 + \Theta_1 B^{12} + \Theta_2 B^{24} + \Theta_3 B^{36} + \Theta_4 B^{48})a_t \]
\[ y_t - y_{t-1} - y_{t-12} + y_{t-13} = a_t + \theta_1 a_{t-1} + \theta_2 a_{t-2} + \theta_3 a_{t-3} + \theta_4 a_{t-4} + \Theta_1 a_{t-12} + \Theta_2 a_{t-24} + \Theta_3 a_{t-36} + \Theta_4 a_{t-48} \] \[ \begin{aligned} & (y_t - y_{t-1} - y_{t-12} + y_{t-13}) \\ & - \Phi_1 (y_{t-12} - y_{t-13} - y_{t-24} + y_{t-25}) \\ & - \Phi_2 (y_{t-24} - y_{t-25} - y_{t-36} + y_{t-37}) \\ & - \Phi_3 (y_{t-36} - y_{t-37} - y_{t-48} + y_{t-49}) \\ & - \Phi_4 (y_{t-48} - y_{t-49} - y_{t-60} + y_{t-61}) \\ & = a_t + \theta_1 a_{t-1} + \theta_2 a_{t-2} + \theta_3 a_{t-3} + \theta_4 a_{t-4} \\ & \quad + \Theta_1 a_{t-12} + \Theta_2 a_{t-24} + \Theta_3 a_{t-36} + \Theta_4 a_{t-48} \\ & \quad + \theta_1 \Theta_1 a_{t-13} + \theta_2 \Theta_1 a_{t-14} + \theta_3 \Theta_1 a_{t-15} + \theta_4 \Theta_1 a_{t-16} \\ & \quad + \theta_1 \Theta_2 a_{t-25} + \theta_2 \Theta_2 a_{t-26} + \theta_3 \Theta_2 a_{t-27} + \theta_4 \Theta_2 a_{t-28} \\ & \quad + \theta_1 \Theta_3 a_{t-37} + \theta_2 \Theta_3 a_{t-38} + \theta_3 \Theta_3 a_{t-39} + \theta_4 \Theta_3 a_{t-40} \\ & \quad + \theta_1 \Theta_4 a_{t-49} + \theta_2 \Theta_4 a_{t-50} + \theta_3 \Theta_4 a_{t-51} + \theta_4 \Theta_4 a_{t-52} \end{aligned} \]
# Simulasi proses SARIMA(0,1,4)(4,1,4)[12]
set.seed(123)
at <- rnorm(1061, mean = 0, sd = 2)
theta <- c(0.5, -0.3, 0.2, -0.1) # Koefisien MA non-musiman
Theta <- c(0.4, -0.25, 0.15, -0.05) # Koefisien MA musiman
Phi <- c(0.6, -0.4, 0.3, -0.15) # Koefisien AR musiman
n <- length(at)
y <- numeric(n)
# Inisialisasi nilai awal
y[1:61] <- 0
for (t in 62:n) { # Loop dimulai dari 62 karena ada y_t-61 dan a_t-52
y[t] <- (y[t-1] + y[t-12] - y[t-13]) + # (1-B)(1-B^12)yt di sisi kanan
Phi[1] * (y[t-12] - y[t-13] - y[t-24] + y[t-25]) + # Suku dari Phi_1
Phi[2] * (y[t-24] - y[t-25] - y[t-36] + y[t-37]) + # Suku dari Phi_2
Phi[3] * (y[t-36] - y[t-37] - y[t-48] + y[t-49]) + # Suku dari Phi_3
Phi[4] * (y[t-48] - y[t-49] - y[t-60] + y[t-61]) + # Suku dari Phi_4
at[t] +
theta[1]*at[t-1] + theta[2]*at[t-2] + theta[3]*at[t-3] + theta[4]*at[t-4] +
Theta[1]*at[t-12] + Theta[2]*at[t-24] + Theta[3]*at[t-36] + Theta[4]*at[t-48] +
theta[1]*Theta[1]*at[t-13] + theta[2]*Theta[1]*at[t-14] + theta[3]*Theta[1]*at[t-15] + theta[4]*Theta[1]*at[t-16] +
theta[1]*Theta[2]*at[t-25] + theta[2]*Theta[2]*at[t-26] + theta[3]*Theta[2]*at[t-27] + theta[4]*Theta[2]*at[t-28] +
theta[1]*Theta[3]*at[t-37] + theta[2]*Theta[3]*at[t-38] + theta[3]*Theta[3]*at[t-39] + theta[4]*Theta[3]*at[t-40] +
theta[1]*Theta[4]*at[t-49] + theta[2]*Theta[4]*at[t-50] + theta[3]*Theta[4]*at[t-51] + theta[4]*Theta[4]*at[t-52]
}
y <- y[-(1:61)]
# Plot time series
ts.plot(y, main = "Original Time Series", ylab = "y")
# ACF dan PACF plot sebelum differencing
par(mfrow = c(1,2))
acf(y, main = "ACF of y")
pacf(y, main = "PACF of y")
# Plot time series setelah differencing non-seasonal
y_diff1 <- diff(y, 1)
ts.plot(y_diff1, main = "After Non-Seasonal Differencing (d=1)", ylab = "y")
# ACF dan PACF setelah differencing non seasonal
par(mfrow = c(1,2))
acf(y_diff1, main = "ACF after diff d=1")
pacf(y_diff1, main = "PACF after diff d=1")
# Plot time series setelah differencing seasonal
y_diff2 <- diff(y, lag = 12)
ts.plot(y_diff2, main = "After Seasonal Differencing (D=1, s=12)", ylab = "y")
# ACF dan PACF setelah differencing seasonal
par(mfrow = c(1,2))
acf(y_diff2, main = "ACF after diff D=1 s=12")
pacf(y_diff2, main = "PACF after diff D=1 s=12")
# Plot time series setelah differencing non seasonal dan seasonal
y_diff3 <- diff(diff(y), lag = 12)
ts.plot(y_diff3, main = "After Combined Differencing (d=1, D=1, s=12)", ylab = "y")
# ACF dan PACF setelah differencing non seasonal dan seasonal
par(mfrow = c(1,2))
acf(y_diff3, main = "ACF after diff d=1, D=1, s=12")
pacf(y_diff3, main = "PACF after diff d=1, D=1, s=12")