Simulasi ini merupakan contoh kasus dari implementasi fungsi transfer model untuk mengetahui apakah inflasi di tingkat Provinsi DKI Jakarta berpengaruh terhadap tingkat inflasi nasional. Kajian serupa sebelumnya pernah dilakukan oleh Adistia dkk (2015) yang mengkaji tingkat pengaruh inflasi beberapa wilayah di Kota Samarinda, Balikpapan, dan Tarakan terhadap inflasi di tingkat Provinsi Kalimantan Timur. Data diperoleh dari website Bank indonesia dan BPS Provinsi DKI Jakarta. Dana yang dianalisis yaitu inflasi bulanan dimulai tahun 2015 hingga 20
#-NOTES :
#-apabila packages dibawah ini belum diintall, silahakn diinstall terlabih dahulu
library(tfarima)
library(astsa)
library(forecast)
library(tseries)
library(TTR)
library(TSA)
library(graphics)
library(MTS)
library(readxl)
data <- read_excel("C:/Users/user/Desktop/ihk vs inflasi.xlsx",sheet = 3)
data$Inflasi.DKI <- as.numeric(data$Inflasi.DKI) # as numeric
data$Inflasi.Nas<- as.numeric(data$Inflasi.Nas) # as numeric
dim(data) # size data
## [1] 60 4
X <- ts(data[,2],frequency = 12) # Inflasi as Input
plot.ts(X,
ylab="Inflasi",
xlab="Peiode waktu",
main="Inflasi DKI 2015-2019",
col="blue")
points(X)
Y <- ts(data[,3],frequency = 12) # Inflasi as Input
plot.ts(Y,
ylab="Inflasi",
xlab="Peiode waktu",
main="Inflasi Nasional 2015-2019",
col="red")
points(Y)
Xt <- data[,2] # Inflasi DKi as Input
Yt <- data[,3] # Inflasi Nasional as output
plot.ts(Xt, type="l", col="blue",ylab="Inflasi",xlab="Periode waktu",
main="Plot Inflasi DKI vs Inflasi Nasional")
lines(Yt, type="l", col="red")
legend("topright", c("Inflasi DKI","Inflasi Nasional"),
col=c("blue", "red"), lty=1,lwd=1,
cex=0.6, inset=0.02,
box.lty=0)
## input
X.train <- X[1:50]
X.test <- X[51:60]
plot.ts(X.train, col="blue", lty=1,main="Inflasi DKI (Data Latih)")
## output
Y.train <- Y[1:50]
Y.test <- Y[51:60]
plot.ts(Y.train, col="red" , lty=1, main="Inflasi Nasional (Data Latih)",
ylab = "Inflasi",
xlab = "Periode waktu")
Selanjutnya, kita akan terlebih dahulu menentukan model ARIMA untuk Deret Input
acf(X.train)
adf.test(X.train)
## Warning in adf.test(X.train): p-value smaller than printed p-value
##
## Augmented Dickey-Fuller Test
##
## data: X.train
## Dickey-Fuller = -5.0731, Lag order = 3, p-value = 0.01
## alternative hypothesis: stationary
Berdasarkan plot ACF terlihat data menunjukkan sudah stasioner di lag 3. Kemudian, Uji Augmented Dickey-Fuller memperoleh \(p-value=0.01 < \alpha=0.05\), sehingga TOLAK \(H_{0}\)}. Disimpulkan bahwa data sudah stasioner
acf(X.train, lag.max=12)
axis(1, at=1:12, labels=1:12)
pacf(X.train, lag.max=12)
axis(1, at=1:12, labels=1:12)
eacf(X.train)
## AR/MA
## 0 1 2 3 4 5 6 7 8 9 10 11 12 13
## 0 o o x o o o o o x o o o o o
## 1 x o x o o o o o x o o o o o
## 2 x o o o o o o o x o o o o o
## 3 o o o o o o o o x o o o o o
## 4 o o x o o o o o x o o o o o
## 5 x x o o o o o o x o o o o o
## 6 x o o o o o o o x o o o o o
## 7 o o o o o x o o o o o o o o
Berdasarkan ACF, PACF, dan EACf, maka kandidaat model ARIMA yang mungkin yaitu ARIMA(0,0,3),ARIMA(3,0,0),ARIMA(1,0,1),ARIMA(2,0,1)
arima003 <- arima(X.train,order=c(0,0,3),method = "ML")
arima300 <- arima(X.train,order=c(3,0,0),method = "ML")
arima101 <- arima(X.train,order=c(1,0,1),method = "ML")
arima201 <- arima(X.train,order=c(2,0,1),method = "ML")
arima001 <- arima(X.train,order=c(0,0,1),method = "ML")
arima003$aic
## [1] 1.458367
arima300$aic
## [1] 6.33596
arima101$aic
## [1] 13.68713
arima201$aic
## [1] 2.321053
arima001$aic
## [1] 11.79601
Berdasarkan nilai AIC terkecil sebagai salah satu kandidat model terbaik, maka model ARIMA(0,0,3) adalah model terpilih.
printstatarima <- function (x, digits = 4,se=TRUE){
if (length(x$coef) > 0) {
cat("\nCoefficients:\n")
coef <- round(x$coef, digits = digits)
if (se && nrow(x$var.coef)) {
ses <- rep(0, length(coef))
ses[x$mask] <- round(sqrt(diag(x$var.coef)), digits = digits)
coef <- matrix(coef, 1, dimnames = list(NULL, names(coef)))
coef <- rbind(coef, s.e. = ses)
statt <- coef[1,]/ses
pval <- 2*pt(abs(statt), df=length(x$residuals)-1, lower.tail = FALSE)
coef <- rbind(coef, t=round(statt,digits=digits),sign.=round(pval,digits=digits))
coef <- t(coef)
}
print.default(coef, print.gap = 2)
}
}
printstatarima(arima003)
##
## Coefficients:
## s.e. t sign.
## ma1 -0.0504 0.1247 -0.4042 0.6878
## ma2 -0.2969 0.1226 -2.4217 0.0192
## ma3 -0.6527 0.1628 -4.0092 0.0002
## intercept 0.2674 0.0052 51.4231 0.0000
printstatarima(arima300)
##
## Coefficients:
## s.e. t sign.
## ar1 0.1607 0.1448 1.1098 0.2725
## ar2 -0.2477 0.1377 -1.7988 0.0782
## ar3 -0.3338 0.1431 -2.3326 0.0238
## intercept 0.2634 0.0240 10.9750 0.0000
printstatarima(arima101)
##
## Coefficients:
## s.e. t sign.
## ar1 -0.1068 0.3368 -0.3171 0.7525
## ma1 0.4041 0.2930 1.3792 0.1741
## intercept 0.2570 0.0467 5.5032 0.0000
printstatarima(arima201)
##
## Coefficients:
## s.e. t sign.
## ar1 0.9601 0.1325 7.2460 0.0000
## ar2 -0.4528 0.1310 -3.4565 0.0011
## ma1 -1.0000 0.0604 -16.5563 0.0000
## intercept 0.2676 0.0043 62.2326 0.0000
printstatarima(arima001)
##
## Coefficients:
## s.e. t sign.
## ma1 0.3190 0.1413 2.2576 0.0285
## intercept 0.2562 0.0485 5.2825 0.0000
Berdasarkan uji signiifkansi model, model dengan semua parameter signifikan adalah ARIMA(2,0,1), sehingga model terbaiknya adalah ARIMA(2,0,1)
mm1=arima(X.train,order=c(2,0,1),method = "ML")
mm1
##
## Call:
## arima(x = X.train, order = c(2, 0, 1), method = "ML")
##
## Coefficients:
## ar1 ar2 ma1 intercept
## 0.9601 -0.4528 -1.0000 0.2676
## s.e. 0.1325 0.1310 0.0604 0.0043
##
## sigma^2 estimated as 0.04868: log likelihood = 2.84, aic = 2.32
#Box-L Jung test
sisaan1 <- residuals(mm1)
ljung <- Box.test(sisaan1, lag=23, type="Ljung")
ljung
##
## Box-Ljung test
##
## data: sisaan1
## X-squared = 24.918, df = 23, p-value = 0.3545
library(tseries)
jarque.bera.test(residuals(mm1))
##
## Jarque Bera Test
##
## data: residuals(mm1)
## X-squared = 3.7075, df = 2, p-value = 0.1566
qqnorm(sisaan1)
qqline(sisaan1)
checkresiduals(mm1)
##
## Ljung-Box test
##
## data: Residuals from ARIMA(2,0,1) with non-zero mean
## Q* = 13.396, df = 6, p-value = 0.03716
##
## Model df: 4. Total lags used: 10
Pengujian dengan metode Box-Ljung test, \(H_{0}\) : Tidak terdapat autokorelasi antar sisaan \(H_{1}\) : Terdapat autokorelasi antar sisaan
Sehingga dengan p-value = 0.3545 maka disimpulkan tidak terdapat autokorelasi dalam sisaan.
f1=c(1,-mm1$coef[1:4]) # Creates a filter to transform Y
f1
## ar1 ar2 ma1 intercept
## 1.0000000 -0.9600749 0.4527577 0.9999976 -0.2676419
#Use convolution method for AR model, recursive method for MA model.
acf(Y.train)
adf.test(Y.train)
## Warning in adf.test(Y.train): p-value smaller than printed p-value
##
## Augmented Dickey-Fuller Test
##
## data: Y.train
## Dickey-Fuller = -6.0967, Lag order = 3, p-value = 0.01
## alternative hypothesis: stationary
Yf=filter(Y.train,f1,method=c("convolution"),sides=1)
yprev=Yf[5:50] # transformed Y
xprev=mm1$residuals[5:50] # transformed X
CCF=ccf(yprev,xprev) # computes the cross-correlations
CCF # retrieves the cross-correlations
##
## Autocorrelations of series 'X', by lag
##
## -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3
## -0.072 -0.146 -0.042 0.018 -0.092 0.175 -0.098 -0.171 -0.139 0.230 0.099
## -2 -1 0 1 2 3 4 5 6 7 8
## 0.059 0.018 0.313 -0.423 -0.021 0.513 -0.038 -0.221 -0.169 -0.130 0.091
## 9 10 11 12 13
## -0.103 0.142 -0.006 -0.295 -0.035
vk=(sd(yprev)/sd(xprev))*CCF$acf # impulse response function
print(vk)
## , , 1
##
## [,1]
## [1,] -0.14204938
## [2,] -0.28768650
## [3,] -0.08353078
## [4,] 0.03489391
## [5,] -0.18205276
## [6,] 0.34555058
## [7,] -0.19336536
## [8,] -0.33732159
## [9,] -0.27444697
## [10,] 0.45404414
## [11,] 0.19555710
## [12,] 0.11695277
## [13,] 0.03570541
## [14,] 0.61932534
## [15,] -0.83589255
## [16,] -0.04232738
## [17,] 1.01397987
## [18,] -0.07473872
## [19,] -0.43646014
## [20,] -0.33293079
## [21,] -0.25601070
## [22,] 0.18063737
## [23,] -0.20415411
## [24,] 0.28082843
## [25,] -0.01105725
## [26,] -0.58312447
## [27,] -0.06835988
ACF=acf(yprev) # autocorrelations of transformed Y
plot(CCF, ylab="CCF",main="Cross-correlations after prewhitening")
#r=0,s=1,b=0
m1 = tfm1(Y.train, X.train, orderX=c(0,1,0),orderN=c(3,0,3))
## Warning in arima(Y, order = c(p, 0, q), xreg = X): possible convergence problem:
## optim gave code = 1
## Warning in sqrt(diag(m1$var.coef)): NaNs produced
## ARMA coefficients & s.e.:
## ar1 ar2 ar3 ma1 ma2 ma3
## coef.arma -0.0144 -0.0192 -0.995 0.0431 0.0713 0.985
## se.arma NaN NaN NaN NaN 0.1188 0.112
## Transfer function coefficients & s.e.:
## intercept X
## v -0.0372 0.9236 0.2401
## se.v 0.0404 0.0991 0.0815
acf(m1$residuals)
pacf(m1$residuals)
#acf(m1$residuals, lag.max=24, plot=FALSE)
#pacf(m1$residuals, lag.max=24, plot=FALSE)
#?tfm1
#m1=tfm1(Y,X,orderX=c(2,2,3),orderN=c(2,0,0))
names(m1) #check contents of output
## [1] "estimate" "sigma2" "residuals" "varcoef" "Nt"
m1$sigma2 #residual variance
## [1] 0.01608011
acf(m1$residuals) # acf of the residuals
ccf(m1$residuals,X.train) # cross-correlation between input series and residuals
ccf(m1$residuals,xprev) # cross-correlation between prewhitened input and residuals
###########################
# using tfarima
###########################
#acf and pacf plot for X
#acf(X, lag.max=24)
#pacf(X, lag.max=24)
#mengindikasikan AR(3)
umx <- um(X.train, ar=2, ma = 1)
umy <- fit(umx, Y.train)
#This umx model is used to prewhiten the input X and the output Y .
#The residuals() function of the tfarima package compute the conditional
#or exact residuals for a time series from an object of class um:
a <- residuals(umx, Y.train, method = "cond")
b <- residuals(umx, X.train, method = "cond")
#Now we can use the ccf() function of the stats package to display the estimated cross
#correlation function for the gas furnace data after filtering. Alternatively, we can use the
#pccf() function of the tfarima defined as
pccf(a, b, um.x = umx, um.y = NULL, lag.max = 16)
#or
CCF =ccf(a,b, ylab="CCF", main="Cross-correlations after prewhitening")
#r=0,s=1,b=0
#delay=b
#r=p
#s=q
tfx <- tfest(Y.train, X.train, delay = 0, p = 0, q = 1, um.x = umx, um.y = umy)
tfx
## $x.name
## [1] "X.train"
##
## $x
## Time Series:
## Start = -2
## End = 50
## Frequency = 1
## [1] -0.08437059 -0.14788930 -0.26879939 -0.41000000 0.24000000 0.19000000
## [7] 0.27000000 0.34000000 0.35000000 0.97000000 0.51000000 0.01000000
## [13] -0.05000000 0.12000000 0.72000000 0.24000000 -0.06000000 0.15000000
## [19] -0.27000000 0.19000000 0.52000000 0.64000000 0.01000000 0.18000000
## [25] 0.25000000 0.24000000 0.27000000 0.99000000 0.33000000 0.05000000
## [31] -0.02000000 0.49000000 0.46000000 0.40000000 0.13000000 0.05000000
## [37] 0.06000000 0.08000000 0.65000000 0.43000000 0.37000000 0.09000000
## [43] 0.06000000 0.45000000 0.48000000 0.26000000 0.03000000 -0.13000000
## [49] 0.28000000 0.30000000 0.60000000 0.24000000 0.26000000
##
## $delay
## [1] 0
##
## $w0
## [1] 0.8986792
##
## $w0.expr
## expression(X.train)
##
## $phi
## [phi0]
## 1
##
## $theta
## [B0] [B1]
## 0.8986792 0.1381048
##
## $ar
## NULL
##
## $ma
## $ma[[1]]
## 1 + 0.15B
##
##
## $kar
## [1] 0
##
## $kma
## [1] 1
##
## $p
## [1] 0
##
## $q
## [1] 1
##
## $um
## Estimate Std. Error
## phi1 0.44417194 3.024424
## phi2 0.06950282 1.851574
## theta1 -0.18654177 3.014843
##
## log likelihood: -10.81845
## Residual standard error: 0.2783618
## aic: 0.552738
## $param
## $param$X.train
## [1] 0.8986792
##
## $param$X.train.w1
## [1] -0.1536753
##
##
## $par.prefix
## [1] "X.train"
##
## $t.start
## [1] 4
##
## $t.end
## [1] 53
##
## $n.back
## [1] 3
##
## $is.adim
## [1] TRUE
##
## attr(,"class")
## [1] "tf"
print(tfx$theta)
## [B0] [B1]
## 0.8986792 0.1381048
print(tfx$phi)
## [phi0]
## 1
#acf(tfx$residuals)
#res<-tfx$residuals
# to fitting the TF model can be estimated as follows
#noise.um <- um(ar=4)
#class(noise.um)
tfmy <- tfarima::tfm(Y.train, inputs = tfx, noise = um(ar=3, ma=3))
#tfmy <- tfm(Y.train, X.train, b = 0, s = 0, p = 0, q = 3)
#tfmy$nt
#?tfm
#printLagpol(tfmy$inputs[[1]]$theta)
#printLagpol(tfmy$inputs[[1]]$phi)
#printLagpol(tfmy$noise$phi)
#?predict.tfm
p <- predict.tfm(tfmy, n.ahead = 10)
p
## Forecast RMSE 95% LB 95% UB
## 51 0.22045812 0.2805785 -0.3294656 0.7703819
## 52 0.18282253 0.3583678 -0.5195655 0.8852105
## 53 0.17971907 0.3800469 -0.5651591 0.9245972
## 54 0.08000464 0.3867399 -0.6779917 0.8380010
## 55 -0.05443236 0.3890488 -0.8169540 0.7080893
## 56 -0.10638847 0.3897869 -0.8703568 0.6575799
## 57 -0.03471430 0.3900416 -0.7991818 0.7297532
## 58 0.08022043 0.3902988 -0.6847512 0.8451921
## 59 0.11723556 0.3903737 -0.6478829 0.8823540
## 60 0.03706245 0.3904238 -0.7281540 0.8022789
plot(p, n.back = 60)
accuracy1 <- accuracy(p$z, Y.test)
accuracy1
## ME RMSE MAE MPE MAPE
## Test set 0.028 0.5532269 0.464 -94.80567 357.4524
Y <- ts(data[,3]) # IHK as output
ts.plot(Y)
Y.train <- Y[1:50]
Y.test <- Y[51:60]
plot.ts(Y.test)
acf(Y.train)
adf.test(Y.train)
## Warning in adf.test(Y.train): p-value smaller than printed p-value
##
## Augmented Dickey-Fuller Test
##
## data: Y.train
## Dickey-Fuller = -6.0967, Lag order = 3, p-value = 0.01
## alternative hypothesis: stationary
acf(Y.train)
pacf(Y.train)
eacf(Y.train)
## AR/MA
## 0 1 2 3 4 5 6 7 8 9 10 11 12 13
## 0 x o x o o x o o x o o x o o
## 1 x o x x o x o o x o o x o o
## 2 x o o o o o o o o o o o o o
## 3 x o o o o o o o o o o o o o
## 4 x o o o o o o o o o o o o o
## 5 o x o o x o o o o o o o o o
## 6 o x x o o o o o o o o o o o
## 7 o o x o o o o o o o o o o o
arima003 <- arima(Y.train,order = c(0,0,3),method = "ML")
arima300 <- arima(Y.train,order = c(3,0,0),method = "ML")
arima201 <- arima(Y.train,order = c(2,0,1),method = "ML")
arima202 <- arima(Y.train,order = c(2,0,2),method = "ML")
arima301 <- arima(Y.train,order = c(3,0,1),method = "ML")
arima003$aic
## [1] 16.86385
arima300$aic
## [1] 16.40916
arima201$aic
## [1] 15.31986
arima202$aic
## [1] 15.09686
arima301$aic
## [1] 16.77244
printstatarima <- function (x, digits = 4,se=TRUE){
if (length(x$coef) > 0) {
cat("\nCoefficients:\n")
coef <- round(x$coef, digits = digits)
if (se && nrow(x$var.coef)) {
ses <- rep(0, length(coef))
ses[x$mask] <- round(sqrt(diag(x$var.coef)), digits = digits)
coef <- matrix(coef, 1, dimnames = list(NULL, names(coef)))
coef <- rbind(coef, s.e. = ses)
statt <- coef[1,]/ses
pval <- 2*pt(abs(statt), df=length(x$residuals)-1, lower.tail = FALSE)
coef <- rbind(coef, t=round(statt,digits=digits),sign.=round(pval,digits=digits))
coef <- t(coef)
}
print.default(coef, print.gap = 2)
}
}
printstatarima(arima003)
##
## Coefficients:
## s.e. t sign.
## ma1 0.0536 0.1433 0.3740 0.7100
## ma2 -0.5705 0.1369 -4.1673 0.0001
## ma3 -0.4832 0.1167 -4.1405 0.0001
## intercept 0.2827 0.0059 47.9153 0.0000
printstatarima(arima300)
##
## Coefficients:
## s.e. t sign.
## ar1 0.2735 0.1331 2.0548 0.0452
## ar2 -0.2844 0.1342 -2.1192 0.0392
## ar3 -0.3674 0.1358 -2.7054 0.0094
## intercept 0.2732 0.0274 9.9708 0.0000
printstatarima(arima201)
##
## Coefficients:
## s.e. t sign.
## ar1 0.9493 0.1885 5.0361 0.0000
## ar2 -0.5905 0.1277 -4.6241 0.0000
## ma1 -0.7659 0.2592 -2.9549 0.0048
## intercept 0.2793 0.0150 18.6200 0.0000
printstatarima(arima202)
##
## Coefficients:
## s.e. t sign.
## ar1 1.0045 0.0735 13.6667 0.0000
## ar2 -0.9315 0.0875 -10.6457 0.0000
## ma1 -0.8803 0.1798 -4.8960 0.0000
## ma2 0.6270 0.2526 2.4822 0.0165
## intercept 0.2707 0.0293 9.2389 0.0000
printstatarima(arima301)
##
## Coefficients:
## s.e. t sign.
## ar1 0.6094 0.3060 1.9915 0.0520
## ar2 -0.4289 0.1977 -2.1694 0.0349
## ar3 -0.2304 0.2113 -1.0904 0.2809
## ma1 -0.4128 0.3080 -1.3403 0.1863
## intercept 0.2762 0.0211 13.0900 0.0000
modelku <- arima(Y.train, order=c(2,0,2),method = "ML")
#Box-L Jung test
sisaan <- residuals(modelku)
ljung <- Box.test(sisaan, lag=23, type="Ljung")
ljung
##
## Box-Ljung test
##
## data: sisaan
## X-squared = 21.576, df = 23, p-value = 0.546
library(tseries)
jarque.bera.test(residuals(modelku))
##
## Jarque Bera Test
##
## data: residuals(modelku)
## X-squared = 4.6089, df = 2, p-value = 0.09981
qqnorm(sisaan)
qqline(sisaan)
acf(sisaan)
Pengujian dengan metode Box-Ljung test, \(H_{0}\) : Tidak terdapat autokorelasi antar sisaan \(H_{1}\) : Terdapat autokorelasi antar sisaan
Sehingga dengan p-value = 0.546 maka disimpulkan tidak terdapat autokorelasi dalam sisaan. Terlihat juga pada plot ACF yang tidak ada lag signiifkan.
dugaan202 <- fitted(modelku)
cbind(Y.train, dugaan202)
## Time Series:
## Start = 1
## End = 50
## Frequency = 1
## Y.train dugaan202
## 1 -0.24 0.15028239
## 2 -0.36 0.02896813
## 3 0.17 0.22019311
## 4 0.36 0.59672822
## 5 0.50 0.63480017
## 6 0.54 0.39751276
## 7 0.93 0.13026864
## 8 0.39 0.06347149
## 9 -0.05 -0.01517790
## 10 -0.08 0.07092377
## 11 0.21 0.32835174
## 12 0.96 0.54690003
## 13 0.51 0.58198208
## 14 -0.09 0.19092261
## 15 0.19 -0.11217141
## 16 -0.45 0.08349035
## 17 0.24 0.28101806
## 18 0.66 0.61290654
## 19 0.69 0.62319893
## 20 -0.02 0.29999423
## 21 0.22 -0.08825594
## 22 0.14 0.01860746
## 23 0.47 0.27307895
## 24 0.42 0.49542370
## 25 0.97 0.42491618
## 26 0.23 0.30696531
## 27 -0.02 -0.01202030
## 28 0.09 -0.02458741
## 29 0.39 0.25412792
## 30 0.69 0.51111575
## 31 0.22 0.50849718
## 32 -0.07 0.19535706
## 33 0.13 0.02844455
## 34 0.01 0.19098215
## 35 0.20 0.36291290
## 36 0.71 0.47248654
## 37 0.62 0.46662348
## 38 0.17 0.22629669
## 39 0.20 -0.01005935
## 40 0.10 0.07330411
## 41 0.21 0.27332508
## 42 0.59 0.44124251
## 43 0.28 0.47734305
## 44 -0.05 0.24964094
## 45 -0.18 0.07997696
## 46 0.28 0.15772622
## 47 0.27 0.42924803
## 48 0.62 0.47821135
## 49 0.32 0.39758226
## 50 -0.08 0.15208234
plot.ts(Y.train)
points(Y.train)
par(col="red")
lines(dugaan202)
par(col="black")
ramalan202 <- predict(modelku, n.ahead=10)
ramalan202
## $pred
## Time Series:
## Start = 51
## End = 60
## Frequency = 1
## [1] 0.02820057 0.20830335 0.43393502 0.49281441 0.34178853 0.13524437
## [7] 0.06845359 0.19375339 0.38182582 0.45402537
##
## $se
## Time Series:
## Start = 51
## End = 60
## Frequency = 1
## [1] 0.2506446 0.2525697 0.2565569 0.2670846 0.2690682 0.2715194 0.2796496
## [8] 0.2816292 0.2831052 0.2894036
plot(modelku, n.ahead=10)
par(col="red")
lines(dugaan202)
par(col="black")
accuracy202 <- accuracy(ramalan202$pred, Y.test)
accuracy202
## ME RMSE MAE MPE MAPE
## Test set -0.02983444 0.18484 0.1531838 -79.90365 139.6953