Pythonで学ぶGARCHモデル
Chelsea Yang
Data Science Instructor
ルール1:お金を失わないこと
ルール2:ルール1を忘れないこと
―― ウォーレン・バフェット

VaRはValue at Risk(価値のリスク)
3要素:
1日・5%のVaRが100万ドル
1日で100万ドル以上下落する確率が5%
10日・1%のVaRが900万ドル
10日で900万ドル以上下落する確率が1%

GARCHでより現実的なVaR推定
VaR = 平均 + (GARCHボラ) * 分位点
VaR = mean_forecast.values + np.sqrt(variance_forecast).values * quantile
# Specify and fit a GARCH model
basic_gm = arch_model(bitcoin_data['Return'], p = 1, q = 1,
mean = 'constant', vol = 'GARCH', dist = 't')
gm_result = basic_gm.fit()
# Make variance forecast
gm_forecast = gm_result.forecast(start = '2019-01-01')
ステップ2: 先行きの平均とボラティリティを取得
mean_forecast = gm_forecast.mean['2019-01-01':]
variance_forecast = gm_forecast.variance['2019-01-01':]
ステップ3: 信頼水準に応じて分位点を取得
標準化残差の分布(GARCHの仮定)に基づき分位点を推定
# Assume a Student's t-distribution
# ppf(): Percent point function
q_parametric = garch_model.distribution.ppf(0.05, nu)
GARCH標準化残差の実測分布に基づき分位点を推定
q_empirical = std_resid.quantile(0.05)
Pythonで学ぶGARCHモデル