Вы находитесь на странице: 1из 9

Menampilkan Data

data()
bj=BJsales
bj
Time Series:
Start = 1
End = 150
Frequency = 1
[1] 200.1 199.5
[13] 201.5 203.5
[25] 218.7 219.8
[37] 218.9 217.8
[49] 222.2 220.7
[61] 212.1 211.4
[73] 210.0 209.7
[85] 218.8 220.7
[97] 246.3 247.7
[109] 250.4 250.7
[121] 261.6 260.8
[133] 257.8 257.7
[145] 262.9 263.3

199.4
204.9
220.5
217.7
220.0
213.1
208.8
222.2
247.6
253.0
259.8
257.2
262.8

198.9
207.1
223.8
215.0
218.7
212.9
208.8
226.7
247.8
253.7
259.0
257.5
261.8

199.0
210.5
222.8
215.3
217.0
213.3
208.8
228.4
249.4
255.0
258.9
256.8
262.2

Pengeplotan Data Penjualan BjSales


plot(bj)

200.2
210.5
223.8
215.9
215.9
211.5
210.6
233.2
249.0
256.2
257.4
257.5
262.7

198.6
209.8
221.7
216.7
215.8
212.3
211.9
235.7
249.9
256.0
257.7
257.0

200.0
208.8
222.3
216.7
214.1
213.0
212.8
237.1
250.5
257.4
257.9
257.6

200.3
209.5
220.8
217.7
212.3
211.0
212.5
240.6
251.5
260.4
257.4
257.3

201.2
213.2
219.4
218.7
213.9
210.7
214.8
243.8
249.0
260.0
257.3
257.5

201.6
213.7
220.1
222.9
214.6
210.1
215.3
245.3
247.6
261.3
257.6
259.6

201.5
215.1
220.6
224.9
213.6
211.4
217.5
246.0
248.8
260.4
258.9
261.1

Pengeplotan Time Series dengan frequency=15 :


timeseries=ts(bj,frequency=15)
plot(timeseries)

Pengeplotan Dekomposisi BJSales


decom=decompose(timeseries)
plot(decom)

Pengeplotan ACF dan PACF BJSales


acf(bj,type="correlation",lag=15)

acf(bj,type="partial",lag=15)

Berdasarkan plot PACF, dapat diketahui bahwa orde AR adalah satu atau dapat ditulis
AR(1), sehingga dapat dicari model terbaik dari ARIMA.

Model ARIMA Terbaik :


1. ARIMA (1, 0, 0)
mod.bj00=arima(bj,c(1,0,0))
mod.bj00
Call:
arima(x = bj, order = c(1, 0, 0))
Coefficients:
ar1 intercept
0.9987 231.2754
s.e. 0.0017 28.6259
sigma^2 estimated as 2.247: log likelihood = -276.55, aic
= 559.11

2. ARIMA (1, 1, 1)
mod.bj10=arima(bj,c(1,1,0))
mod.bj10
Call:
arima(x = bj, order = c(1, 1, 0))
Coefficients:
ar1
0.3647
s.e. 0.0759
sigma^2 estimated as 1.945: log likelihood = -261.06, aic
= 526.13

3. ARIMA (1, 2, 0)
mod.bj20=arima(bj,c(1,2,0))
mod.bj20
Call:
arima(x = bj, order = c(1, 2, 0))
Coefficients:
ar1
-0.4726
s.e. 0.0720
sigma^2 estimated as 2.215: log likelihood = -268.98, aic
= 541.96

4. ARIMA (1, 0, 1)
mod.bj01=arima(bj,c(1,0,1))
mod.bj01
Call:
arima(x = bj, order = c(1, 0, 1))
Coefficients:
ar1
ma1 intercept
0.9981 0.2570 231.3156
s.e. 0.0025 0.0653 27.4289
sigma^2 estimated as 2.041: log likelihood = -269.4, aic = 546.79

5. ARIMA (1, 1, 1)
mod.bj11=arima(bj,c(1,1,1))
mod.bj11
Call:
arima(x = bj, order = c(1, 1, 1))
Coefficients:
ar1
ma1
0.8800 -0.6415
s.e. 0.0644 0.1035
sigma^2 estimated as 1.775: log likelihood = -254.37, aic =
514.74

6. ARIMA (1, 2, 1)
mod.bj21=arima(bj,c(1,2,1))
mod.bj21
Call:
arima(x = bj, order = c(1, 2, 1))
Coefficients:
ar1
ma1
0.0528 -0.7801
s.e. 0.1313 0.1004
sigma^2 estimated as 1.863: log likelihood = -256.49, aic =
518.97

7. ARIMA (1, 0, 2)
mod.bj02=arima(bj,c(1,0,2))
mod.bj02
Call:
arima(x = bj, order = c(1, 0, 2))
Coefficients:
ar1
ma1
ma2 intercept
0.9975 0.2753 0.1942 231.3721
s.e. 0.0033 0.0822 0.0693 26.5343
sigma^2 estimated as 1.938: log likelihood = -265.58, aic =
541.16

8. ARIMA (1, 1, 2)
mod.bj12=arima(bj,c(1,1,2))
mod.bj12
Call:
arima(x = bj, order = c(1, 1, 2))
Coefficients:
ar1
ma1
ma2
0.8705 -0.6483 0.0286
s.e. 0.0743 0.1101 0.0904
sigma^2 estimated as 1.774: log likelihood = -254.32, aic =
516.64

9. ARIMA (1, 2, 2)
mod.bj22=arima(bj,c(1,2,2))
mod.bj22
Call:
arima(x = bj, order = c(1, 2, 2))
Coefficients:
ar1
ma1
ma2
0.8598 -1.6253 0.6253
s.e. 0.0797 0.1144 0.1133
sigma^2 estimated as 1.766: log likelihood = -253.79, aic =
515.58

Memilih Model Terbaik :


Dalam memilih model terbaik, bisa dilihat dari nilai AIC nya, yaitu semakin kecil nilai
AIC, maka model tersebut semakin baik. Berdasarkan beberapa model diatas, AIC yang
terkecil adalah 514.74 pada ARIMA (1,1,1).
Jadi, model yang dipilih adalah ARIMA (1,1,1) :
Y t =(1+)Y t 1 Y t2 +e te t1
Diperoleh model :
Call:
arima(x = bj, order =
c(1, 1, 1))
Coefficients:
ar1
ma1
0.8800 -0.6415
s.e. 0.0644 0.1035
Berdasar output tersebut :
=0.88 dan =0.6415
Sehingga :

Y t =(1+)Y t 1 Y t2 +e te t1
Y t =(1+0.88) Y t10.88 Y t 2+ et (0.6415 ) et 1
Y t =1.88Y t10.88 Y t 2+ et + 0.6415 et 1
Pengeplotan Time Series :
x=mod.bj11$residuals
plot(x)

TUGAS
KOMPUTASI STATISTIKA
ANALISIS TIME SERIES

oleh :

Nama
NIM
Kelas
Dosen Pengampu

:
:
:
:

Walidah Purnaningsih
125090500111038
Statistika B
Samingun H, S.Si, M.Cs

PROGRAM STUDI STATISTIKA


JURUSAN MATEMATIKA
FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM
UNIVERSITAS BRAWIJAYA

MALANG
2014

Вам также может понравиться