• Tidak ada hasil yang ditemukan

PENGANTAR TIME SERIES ANALYSIS: POLITEKNIK STATISTIKA STIS Pertemuan I / 2022 For Better Official Statistics Konsep dan Pemodelan

N/A
N/A
MUHAMMAD -

Academic year: 2023

Membagikan "PENGANTAR TIME SERIES ANALYSIS: POLITEKNIK STATISTIKA STIS Pertemuan I / 2022 For Better Official Statistics Konsep dan Pemodelan"

Copied!
55
0
0

Teks penuh

(1)

PENGANTAR

TIME SERIES ANALYSIS:

POLITEKNIK STATISTIKA STIS

Pertemuan I / 2022

For Better Official Statistics

Konsep dan Pemodelan

Nasrudin

(2)

Forecasting

• Mengapa diperlukan?

• Bagaimana caranya?

(3)

Econometrics Quotes

Dear past, thank you for all the lessons.

Dear future, I am ready.

Don't let us use a method inappropriately, as Zorro is wrong in wearing a mask

I have seen the future and it is just like the present ,

only longer.

Kehlog Albran (1973)

(4)

DATA

4

For Better Official Statistics

Cross-Section

Time Series

Panel

(5)
(6)
(7)

Pemodelan & Peramalan dengan Data Time Series

Case 2 Sales predicted by other variables that affect it

Case 1 Sales predicted by sales pattern in the past

https://exceldashboardschool.com/sales-forecast-chart/

https://www.sganalytics.com/blog/choosing-right-price-elasticity-model/

SALE t = a + b.SALE t-1 +et SALEt = a + b.t + c.t 2 +et

SALE t = a + b.PRICE t +et

SALE t = a + b.PRICE t +c.ADV t +et

(8)

Analisis Time Series

Time Series Forecasting pertemuan 1-7

Menjelaskan pola data berdasarkan waktu

• Memprediksi kejadian yang akan datang berdasarkan perilaku variabel tersebut di masa lalu

(Classical) Econometrics

Eksplanatoris atau causality, yakni menganalisis hubungan antar variabel time series

• Mengestimasi parameter-parameter hubungan antar variabel ekonomi, seperti elastisitas, propensitas, multiplier, dsb

menggunakan data time series

(9)
(10)

Okun’s Law

Percenta ge change in real GDP

Change in unemployment rate -4

-2 0 2 4 6 8 10

-3 -2 -1 0 1 2 3 4

1975 1991 1982

2001 1984

1951 1966

2003

1987

3.5 2

Y = − 

Y u

(11)

Classification of Forecasting Methods

Forecasting Method

Objective

Forecasting Methods Subjective (Judgmental)

Forecasting Methods

Time Series

Methods Causal

Methods Analogies

Delphi

PERT

Survey techniques Simple Regression

Multiple Regression Neural Networks Naïve Methods

Moving Averages Exponential Smoothing

Trend Decomposition ARIMA

Neural Networks

Combination of Time Series –Causal Methods

VAR, VECM

Intervention Model

Transfer Function (ARIMAX)

VARIMA (VARIMAX)

Neural Networks

References:

 Makridakis et al.  Hanke and Reitsch  Wei, W.W.S.  Box, Jenkins and Reinsel

(12)
(13)

Pemodelan dan peramalan

(14)

Five steps in the forecasting process (Hanke, 2014):

• Problem formulation and data collection

• Data manipulation and cleaning

• Model building and evaluation

• Model implementation (the actual forecast)

• Forecast evaluation

(15)

Determining whether data will be useful (Hanke, 2014) :

Data should be reliable and accurate. Proper care must be taken that data are col- lected from a reliable source with proper attention given to

accuracy.

Data should be relevant. The data must be representative of the circumstances for which they are being used.

Data should be consistent. When definitions concerning data collection change, adjustments need to be made to retain consistency in historical patterns. This can be a problem, for example, when government agencies change the mix or “market basket” used in determining a cost-of-living index. Years ago personal computers were not part of the mix of products being purchased by consumers; now they are.

Data should be timely. Data collected, summarized, and published on a

timely basis will be of greatest value to the forecaster. There can be too

little data (not enough history on which to base future outcomes) or too

much data (data from irrelevant historical periods far in the past).

(16)

Data manipulation & cleaning :

• Periksa kesamaan periode waktu: menit, harian, pekanan, bulanan, triwulanan, tahunan. Jika belum sama, maka disamakan.

• Periksa kesamaan satuan (unit) dan tahun dasar. Jika belum sama, maka disamakan

Mengatasi “missing data”, dengan interpolasi, deleting cases, dsb

• Mengecek kembali nilai-nilai ekstrim (terlalu tinggi atau terlalu rendah)

• Agregasi/Disagregasi. Pahami data stock (posisi) atau data flow (aliran);

bisa diagregasi atau tidak. Misal nilai tukar (posisi), nilai produksi (flow, bisa diagregasi)

• dll

(17)

Model building and evaluation:

• Eksplorasi pola data

• Memilih teknik peramalan

Evaluasi model: perkiraan akurasi ramalan

(18)

Eksplorasi Pola Data

(19)

19

For Better Official Statistics

Pola Umum Data Time Series

Sebelum memilih model time series yang tepat, pertama kali yang

dilakukan adalah mengeksplorasi pola data.

(20)

(i) Stasioner vs Tidak Stasioner

(21)

Pola Data tidak stasioner

✓Tidak Stasioner pada Rata-

rata ✓ Tidak Stasioner pada Varians

(22)

Case-1: manakah pola data yang stasioner/tidak stasioner

(23)

80,00 85,00 90,00 95,00 100,00 105,00 110,00 115,00 120,00 125,00

1 2 3 4 5 6 7 8 9 101112 1 2 3 4 5 6 7 8 9 101112 1 2 3 4 5 6 7 8 9 101112 1 2 3 4 5 6 7 8 9 101112 1 2 3 4 5 6 7 8

Indeks

Indeks

Case-2: Indeks Produksi, pola data stasioner atau tidak?

(24)

Case-3: Pola data stasioner/tidak stasioner?

(25)

(ii) Dekomposisi Data Time Series

• Komponen jangka panjang: trend dan siklus (cyclical)

• Komponen jangka pendek: musiman (seasonal)

• Komponen random: irregular, tidak tertangkap oleh pola

(26)

Dekomposisi Data Time Series & Stasioneritas

• Trend -> tdk stasioner

• Seasonal ->stasioner

• Trend & seasonal-> tdk stasioner

(27)

Trend dan Cyclic

(28)

28

For Better Official Statistics

Trend dan Cyclic

(29)

Seasonal

(30)

30

For Better Official Statistics

Seasonal atau Calender Variation?

(31)

31

For Better Official Statistics

Seasonal atau Calender Variation?

(32)

Memilih Teknik Peramalan

(33)

Forecasting technique (in this course) :

• Subjective

• Objective

• Causal Method

• Time Series Forecasting

• Deterministic Model

✓ Smoothing methods

✓ Time Series Decomposition

• Stochastic (Statistical) Model

✓ Models for stationary data

✓ Models for non-stationary data

(34)

To select the appropriate forecasting technique properly, the

forecaster must be able to accomplish the following: (see Hanke, 2014: 32-34)

• Define the nature of the forecasting problem.

• Explain the nature of the data under investigation.

• Describe the capabilities and limitations of potentially useful forecasting techniques.

• Develop some predetermined criteria on which the selection decision can be

made.

(35)

Smoothing Method

tujuan untuk mengurangi komponen irregular sehingga

komponen trend, seasonal, dan cyclic lebih jelas terlihat

(36)

Prinsip dasar dekomposisi time series adalah

menguraikan data time

series ke dalam komponen-

komponen pembentuknya,

agar dapat dipahami lebih

baik serta dapat digunakan

untuk peramalan

(37)

Stochastic models (in this course) :

• Stochastic Model: bersifat probabilistic, ada asumsi-asumsi tertentu tentang error.

✓ Models for stationary data: AR, MA, ARMA

✓ Models for non-stationary data: ARIMA, SARIMA

(38)
(39)

Evaluation:

Measuring Forecast Accuracy

(40)
(41)
(42)

Mengukur Kesalahan Peramalan

Bias - The arithmetic sum of the errors

MAD - Mean Absolute Deviation

MAPE – Mean Absolute Percentage Error

• MSE - Mean Square Error - Similar to simple sample variance

Makridakis (pp 43)

• Simbol yg lain, lihat Hanke, Business Forecasting

T F

Y Bias

t t

T

t

/ ) (

/T error) (forecast

1 T

1 t

=

=

=

=

) ( Forecast Error = Y tF t

T F

Y

MAD

t t

T

t

/

|

| /T

| error forecast

|

1

T

1 t

=

=  

= =

T Y

F Y

MAPE

t t t

T

t

/ ] /

| [|

100

1

= 

=

T F

Y MSE

t t

T

t

/ ) (

/T

| error forecast

|

2 1

T

1 t

2

=

=

=

=

(43)

Pemilihan Metode Peramalan Terbaik

Waktu Data Metode A Metode B Metode C

2020.01 12 9,5 12,0 12,0

2020.02 12 11,0 12,0 12,0

2020.03 14 12,5 12,7 12,0

2020.04 13 14,0 13,0 14,0

2020.05 15 15,5 14,0 13,0

2020.06 16 17,0 14,7 15,0

2020.07 19 18,5 16,7 16,0

2020.08 17 20,0 17,3 19,0

2020.09 19 21,5 18,3 17,0

2020.10 21 23,0 19,0 19,0

2020.11 20 24,5 20,0 21,0

2020.12 23 26,0 21,3 20,0

2021.01 26 27,5 23,0 23,0

2021.02 22 29,0 23,7 26,0

2021.03 27 30,5 25,0 22,0

2021.04 25 32,0 24,7 27,0

2021.05 29 33,5 27,0 25,0

2021.06 32 35,0 28,7 29,0

2021.07 35 36,5 32,0 32,0

2021.08 36 38,0 34,3 35,0

2021.09 39,5 35,5 36,0

Forecast

(44)

Waktu Data Metode A Metode B Metode C Metode A Metode B Metode C

2020.01 12 9,5 12,0 12,0 0,20833333 0 0

2020.02 12 11,0 12,0 12,0 0,08333333 0 0

2020.03 14 12,5 12,7 12,0 0,10714286 0,0952381 0,14285714

2020.04 13 14,0 13,0 14,0 0,07692308 0 0,07692308

2020.05 15 15,5 14,0 13,0 0,03333333 0,06666667 0,13333333

2020.06 16 17,0 14,7 15,0 0,0625 0,08333333 0,0625

2020.07 19 18,5 16,7 16,0 0,02631579 0,12280702 0,15789474

2020.08 17 20,0 17,3 19,0 0,17647059 0,01960784 0,11764706

2020.09 19 21,5 18,3 17,0 0,13157895 0,03508772 0,10526316

2020.10 21 23,0 19,0 19,0 0,0952381 0,0952381 0,0952381

2020.11 20 24,5 20,0 21,0 0,225 0 0,05

2020.12 23 26,0 21,3 20,0 0,13043478 0,07246377 0,13043478

2021.01 26 27,5 23,0 23,0 0,05769231 0,11538462 0,11538462

2021.02 22 29,0 23,7 26,0 0,31818182 0,07575758 0,18181818

2021.03 27 30,5 25,0 22,0 0,12962963 0,07407407 0,18518519

2021.04 25 32,0 24,7 27,0 0,28 0,01333333 0,08

2021.05 29 33,5 27,0 25,0 0,15517241 0,06896552 0,13793103

2021.06 32 35,0 28,7 29,0 0,09375 0,10416667 0,09375

2021.07 35 36,5 32,0 32,0 0,04285714 0,08571429 0,08571429

2021.08 36 38,0 34,3 35,0 0,05555556 0,0462963 0,02777778

2021.09 39,5 35,5 36,0

2,489443 1,1741349 1,97965246 Jumlah

20 20 20 waktu (T)

0,12447215 0,05870675 0,09898262 MAPE

12,45 5,87 9,90 MAPE(%)

(TERBAIK)

Forecast abs(Y-F)/Y

Pemilihan Metode Peramalan Terbaik

(45)

Data training vs Data testing

Waktu Data Metode A Metode B Metode C

2020.01 12 9,5 12,0 12,0

2020.02 12 11,0 12,0 12,0

2020.03 14 12,5 12,7 12,0

2020.04 13 14,0 13,0 14,0

2020.05 15 15,5 14,0 13,0

2020.06 16 17,0 14,7 15,0

2020.07 19 18,5 16,7 16,0

2020.08 17 20,0 17,3 19,0

2020.09 19 21,5 18,3 17,0

2020.10 21 23,0 19,0 19,0

2020.11 20 24,5 20,0 21,0

2020.12 23 26,0 21,3 20,0

2021.01 26 27,5 23,0 23,0

2021.02 22 29,0 23,7 26,0

2021.03 27 30,5 25,0 22,0

2021.04 25 32,0 24,7 27,0

2021.05 29 33,5 27,0 25,0

2021.06 32 35,0 28,7 29,0

2021.07 35 36,5 32,0 32,0

2021.08 36 38,0 34,3 35,0

2021.09 39,5 35,5 36,0

Forecast

Data Training (in Sample): 80% =>

Fitting Model

Data Testing (Out Sampel): 20% =>

validasi

(46)

Get the pattern,

predict the future

Prinsip dasar time series forecasting:

(47)

Berikut gambar-gambar

pola data time series .

Temukan polanya dan

bagaimana cara mem-forecasting-nya

(48)

Example: De-Seasonalizing

Fit a regression line to the deseasonalized observations – y’ (using time as the

independent variable).

(49)
(50)
(51)

Keterangan : Data penjualan SARDEN di PT Blambangan Jaya, Banyuwangi

(52)

Reference: Badan Pusat Statistik (BPS) Indonesia Krisis di Indonesia

Pertengahan 1997

(53)

Reference: Badan Pusat Statistik (BPS) Bali

(54)
(55)

55

For Better Official Statistics

Referensi

Dokumen terkait

In this study, I take on the role of participant-researcher to work together with two other teachers in my school to share and study our personal and professional stories of lived