Modul arima arch garch var

Mengukur Risiko dengan Dynamic Value at Risk
Dalam pasar keuangan terdapat istilah risiko pasar (market risk), yaitu potensi kerugian maupun
keuntungan dari perubahan tak terduga yang disebabkan oleh berbagai macam risiko pasar. Risiko ini
tidak bisa dihindari, sehingga investor perlu memahami dan mempertimbangkan tingkat risiko
tersebut sebelum mengambil keputusan.
Oleh karena itu muncul berbagai pendekatan untuk mengukur tingkat risiko, salah satunya adalah
Value at Risk (VaR). VaR adalah perhitungan statistik untuk mengukur dan mengestimasi potensi
kerugian maksimum pada tingkat kepercayaan tertentu (misalnya 95%, 99%, dan 99,5%). Nilai VaR
sangat mudah dipahami, sehingga sering digunakan sebagai landasan untuk membuat keputusan
pengambilan risiko maupun manajemen risiko.
Terdapat berbagai pendekatan untuk menghitung VaR dengan kelebihannya masing-masing, namun
kunci utamanya adalah volatilitas. Volatilitas mengacu pada kondisi perubahan harga yang tidak stabil,
cenderung bervariasi, dan sulit diperkirakan. Dalam ilmu statistika, volatilitas diukur dengan
menggunakan simpangan baku (standar deviasi) atau ragam (varian).
Untuk mengukur volatilitas, pendekatan model Autoregressive conditionally heteroscedastic (ARCH)
dan Generalised ARCH (GARCH) sering digunakan, karena dapat menangkap pengelompokan
volatilitas (volatility clustering) dalam data. Namun sebelum menggunakan model ARCH/GARCH,
diperlukan model induk yaitu Autoregresif Integrated Moving Average (ARIMA) untuk menjelaskan
hubungan deret waktu tersebut terhadap nilainya sendiri di masa lalu.
Dengan conditional variance atau volatility clustering yang didapatkan dari model ARCH/GARCH, nilai
VaR yang keluar menjadi dinamis (mengikuti deret waktu pada data). Berbeda dengan beberapa
pendekatan lain yang hanya memiliki satu nilai VaR saja (statis).
Pada kesempatan ini, akan dilakukan pengukuran risiko pada indeks saham JCI (Jakarta Composite
Index) dengan VaR, yang diukur volatilitasnya menggunakan ARCH/GARCH, dengan menggunakan
model induk ARIMA.
Data yang digunakan adalah data deret waktu (time series) harian, yaitu hari kerja (weekday) dari 1
Januari 2001 hingga 24 Agustus 2020.
Tahapan untuk Mengukur Risiko dengan Dynamic Value at Risk
PERSIAPAN DATA
1. Mengimpor data dari excel
Langkah:
File > Import > Excel Spreadsheet > Browse lokasi file excel >
Command:
import excel “C:\Users\HP\Desktop\data time series.xlsx”, sheet(“SAHAM”) firstrow
2. Membuat time variable dari dataset
Langkah 1:
Data > Other utilities > Create a business calendar >
Langkah 2:
Statistics > Time series > Setup and utilities > Declare dataset to be time-series data >
Command:
bcal create calendar, from(DATE) generate(dates)
tsset dates
3. Melihat isi dataset pada baris 1-10
Command:
list in 1/10
4. Membuat compound return JCI (karena data bersifat continous)
Command:
gen rc_jci = ln(JCI/L.JCI)
Atau simple return (ketika data bersifat diskrit):
gen rs_jci = (JCI+L.JCI)/L.JCI
BLACK BOX MODELING (BOX-JENKINS)
Identifikasi Model ARIMA (p,d,q)
1. Membuat line chart untuk melihat gambaran data
Langkah:
Graphics > Time-series graphs > Line plots > Create >
Command:
tsline rc_jci
2. Uji stasioneritas (untuk menentukan ordo Integrasi (I) pada model ARIMA)
Langkah:
Statistics > Time series > Tests > Augmented Dickey-Fuller unit-root test >
Command:
dfuller rc_jci
3. Identifikasi hasil uji stasioneritas
Dickey-Fuller test for unit root
Number of obs
=
5124
———- Interpolated Dickey-Fuller ——–Test
1% Critical
5% Critical
10% Critical
Statistic
Value
Value
Value
—————————————————————————–Z(t)
-64.432
-3.430
-2.860
-2.570
—————————————————————————–MacKinnon approximate p-value for Z(t) = 0.0000
H0: Deret tidak stasioner (unit root)
H1: Deret stasioner
Jika dilihat dari Test Statistic yang bernilai negatif dan nilai p-value yang lebih kecil dari α (5%),
maka keputusan yang diambil adalah tolak H0. Sehingga dapat disimpulkan bahwa deret
compound return JCI telah stasioner pada tingkat level, dan terintegrasi pada pada ordo (d)
ke-0.
4. Membuat Korelogram
Langkah 1 (untuk korelogram (ACF)):
Statistics > Time series > Graphs > Correlogram (ac) >
Langkah 2 (untuk korelogram parsial (PACF)):
Statistics > Time series > Graphs > Partial correlogram (pac) >
Command 1 (untuk korelogram (ACF)):
ac rc_jci
Command 2 (untuk korelogram parsial (PACF)):
pac rc_jci
Atau (untuk menampilkan nilai ACF dan PACF):
corrgram rc_jci
5. Mengidentifikasi output korelogram (ACF) dan korelogram parsial (PACF)
Auto Correlation Function (ACF) Plot
Partial Auto Correlation Function (PACF) Plot
Identifikasi ACF dan PACF
Berdasarkan korelogram (ACF) dan korelogram parsial (PACF), dapat dilihat bahwa keduanya
sama-sama signifikan pada lag 1 dan selebihnya bernilai nol (cut off). Lag 1 dapat dikatakan
signifikan karena keluar dari selang kepercayaan (confidence interval), yaitu 95%.
Oleh karena itu dapat ditentukan model tentatif ARMA, AR maupun MA dengan lag 1 sebagai
ordo dari proses AR(p)/MA(q).
Model tentatif yang dipilih:
1) AR(1)
2) MA(1)
3) ARIMA (1,0,1) / ARMA (1,1)
Estimasi Parameter
1. Mengestimasi model
Langkah:
Statistics > Time series > ARIMA and ARMAX models >
Ulangi langkah tersebut sesuai dengan model tentatif yang telah dipilih.
Command (model 1):
arima rc_jci, ar(1)
estat ic
predict res1, residual
Command (model 2):
arima rc_jci, ma(1)
estat ic
predict res2, residual
Command (model 3):
arima rc_jci, ar(1) ma(1)
estat ic
predict res3, residual
Diagnostik
1. Diagnosa residual (menguji sifat white noise)
Langkah:
Statistics > Time Series > Tests > Portmanteau white-noise test >
Ulangi langkah tersebut hingga residual ke-3
Command 1 (Portmanteau white-noise test):
wntestq res1
wntestq res2
wntestq res3
Command 2 (ACF dan PACF):
corrgram res1
corrgram res2
corrgram res3
2. Identifikasi sifat white noise
Model
AR(1)
MA(1)
ARIMA(1,0,1)
p-value white noise test
0.2766
0.2138
0.285
H0: Residual bersifat white noise
H1: Residual tidak bersifat white noise
Berdasarkan nilai p-value masing-masing model yang lebih besar dari α (5%), maka keputusan
yang diambil adalah terima H0. Sehingga dapat disimpulkan bahwa ketiga model tentatif
tersebut memiliki residual yang bersifat white noise.
Sifat white noise juga dapat dilihat dari nilai p-value ACF dan PACF yang tidak signifikan pada
lag awal, yaitu lebih besar dari α (5%).
lag
1
2
3
4
5
6
7
8
9
10
p-value
corrgram res2
0.9006
0.5257
0.4773
0.2716
0.394
0.208
0.2168
0.2876
0.376
0.4604
corrgram res1
0.9792
0.9309
0.7188
0.4086
0.5489
0.3039
0.3072
0.3919
0.4901
0.5767
corrgram res3
0.9975
0.9794
0.7312
0.4159
0.5565
0.3104
0.3132
0.3989
0.4975
0.5838
3. Pemilihan Model Terbaik (Overfitting)
Model
AR(1)
MA(1)
ARIMA(1,0,1)
AIC
-30144.35
-30143.19
-30142.39
BIC
-30124.72
-30123.57
-30116.23
Karena ketiga model tentatif tersebut memiliki residual yang bersifat white noise, maka model
terbaik dipilih berdasarkan nilai AIC dan BIC terkecil. Sehingga dapat disimpulkan bahwa
model AR(1) adalah model terbaik yang memenuhi kriteria tersebut.
Forcasting (out-of-sample 4 hari)
Command:
tsappend, add(4)
arima rc_jci, arima(1,0,0)
predict fc
Command:
tsline rc_jci fc
Model ARCH/GARCH
Identifikasi
1. Uji Efek ARCH (Heteroskedastisitas)
Langkah 1 (Uji Lagrange Multiplier):
Statistics > Linear model an related > Linear Regression >
Langkah 2 (Uji Lagrange Multiplier):
Statistics > Linear model an related > Regression diagnostics > Specification test, ect. >
Command 1 (Uji Lagrange Multiplier):
reg res1
estat archlm
2. Identifikasi efek ARCH
H0: Tidak ada efek ARCH
H1: Ada efek ARCH
Berdasarkan hasil uji LM pada residual dari model ARIMA dengan lag 1 (ordo ke-q (MA)), dapat
dilihat nilai p-value yang lebih kecil dari α (5%), maka keputusan yang diambil adalah tolak H0.
Sehingga dapat disimpulkan bahwa residual dari model ARIMA yang sebelumnya telah dibuat
memiliki efek ARCH (Heteroskedastisitas).
Model standar GARCH(1,1) disarankan pada beberapa literatur karena sudah diangggap cukup
untuk menangkap pengelompokan volatilitas (volatility clustering) pada data finansial. Model
ini juga dapat disesuaikan menjadi GARCH(p,q), namun jarang digunakan di literatur finansial.
Estimasi Parameter
1. Estimasi ARIMA(1,0,0) GARCH(1,1)
Langkah:
Statistics > Time Series > ARCH/GARCH > ARCH and GARCH models >
Command:
arch rc_jci, ar(1) arch(1) garch(1)
Forcasting (out-of-sample 4 hari)
1. Forcast model ARIMA(1,0,0) GARCH(1,1)
Command:
predict fc2
2. Forcast conditional variance
Command:
predict cvar, variance
Dynamic Value at Risk
1. Menghitung Dynamic Value at Risk
VaR = mean forcast + (GARCH volatility) * quantile
Command Stata 1 (menghitung jumlah data (n)):
count
Command Stata 2 (menghitung VaR dengan n=5130, dan qnorm(0.05)):
gen VaR_95 = sum(fc2)/5130 + sqrt(cvar) * (-1.645)
Command Stata 3 (VaR dalam nominal: 100 juta):
gen VaR_95_nominal = VaR_95 * 100000000
Command Stata 4 (convert VaR ke bulanan: 25 hari kerja):
gen VaR_95_m_nominal = VaR_95_nominal * sqrt(25)
Command Stata 5 (perbandingan data return dengan VaR harian):
tsline rc_jci VaR_95
Hasil Plot compound return JCI dengan VaR (95% Confidence Interval)

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with StudyAcademia.com
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat