Vous êtes sur la page 1sur 2

Extension

of FOREX Example to Include an IGARCH(1,1) fitted model and VaR using


RiskMetrics Methodology

We use Scenario 2 data from the previous FOREX example which includes crossing the spread. We
calculate minute return meaning the return at each minute. We look at the exchange rate and create a
column price. If traded amounts were negative at a time index position, the price column was populated
with the bid price. When the traded amount was positive, the offer price was entered into the price
column. The minute return was then calculated as the log return r at time t (noted as r [ t ]) and defined
as: r [ t ] = ln (price [ t ] / price [ t-1 ]). This return is seen in column rt. It is a continuously compounded
minute return or log return where ln denotes the natural logarithm. The return rt is a complete and scale-
free summary of the investment opportunity at each minute of the day.
RiskMetrics assumes that the continuously compounded minute return r [ t ] follows a conditional normal
distribution with conditional mean mu [ t ] and conditional variance (sigma**2) [ t ] which evolve in time
according to an IGARCH(1,1) model where **2 denotes squared values:

mu [ t ] = 0
(sigma**2) [ t ] = alpha * (sigma**2) [ t - 1 ] + (1 alpha) * (r **2) [ t - 1 ] (1)
alpha between (0 , 1), coefficients alpha satisfy some regulatory conditions

The method assumes that the logarithm of the minute price price [ t ] satisfies the difference equation:
price [ t] price [ t-1 ] = a [ t ] where a [ t ] = sigma [ t ] * epsilon [ t ] is an IGARCH (1,1) process without
drift.

a [ t ] = innovation or shock at time [ t ]


{epsilon} is a sequence of independent and identically distributed random variables with mean
zero and variance 1
sigma [ t ] = conditional standard deviation of r [ t ] given information F [ t 1 ] at time (t 1)
(sigma**2) [ t ] = conditional variance of r [ t ] given information F [ t 1 ] at time (t 1)

Equation (1) is the volatility equation for r [ t ] which governs the time evolution of the conditional
variance of the minute return. It is also called the one-step ahead volatility forecast.
For a k period horizon, the log return from time [ t + 1 ] to [ t + k ] is
rt [k] = r [ t + 1 ] + + r [ t + k 1 ] + r [ t + k ] such that the conditional distribution rt [k] | F[t] (given
information F at time t) is normal with mean zero and variance (sigma**2) [ k ] .
Equation (1) can be rewritten as:
(sigma**2) [ t + i ] = (sigma**2) [ t + i - 1 ] + (1 alpha) * (sigma**2) [ t + i ] ((epsilon**2) [ t + i ] - 1)
for i = 2, , k .

Under this special IGARCH(1,1) model, the conditional variance of rt [k] is proportional to the time horizon
k. Given the tail probability for VaR, RiskMetrics uses the result rt [k] | F[t] follows the normal distribution
N ( 0, (sigma**2) [ t + 1 ] ) to calculate VaR for the log return. If the tail probability is set to 1%, then VaR
= 2.326 * sigma [ t + 1 ] for the next trading period (which for the currency exchange may be the next
th
day). This is the upper 1% quantile (or the 99 percentile) of a normal distribution with mean zero and
standard deviation sigma [ t + 1 ] . For the next k trading days, VaR [ k] = 2.326 * sqrt (k) * sigma [ t + 1 ]
where sqrt (k) denotes square root of k. Similar arguments can be made for 5% or other percentages (but
with different multiplication values instead of 2.326). The 1% VaR for the next trading day in US dollars is
then: VaR = Amount of position * 2.326 * sigma [ t + 1 ] / 100. Because RiskMetrics assumes log
returns are normally distributed with mean zero (which our data shows is true in our case), the loss
function is symmetric and VaR are the same for long and short financial positions.

To find the coefficients alpha in Equation (1), we need to mazimize the conditional log-likelihood function
logL = Sum( l [ t ]) where l [ t ] = - (ln (2*pi) + ln ((sigma**2) [ t ]) + ((rt **2) [ t ] ) / ((sigma**2) [ t ])
or find the minimum of the negative of this function. This is done in Python with scipy. optimize.fmin .

The fitted IGARCH(1,1) model is:


rt [ t ] = a [ t ]
a [ t ] = sigma [ t ] * epsilon [ t ]
(sigma**2) [ t ] = 0.2168 * (sigma**2) [ t - 1 ] + (1 0.2168) * (a **2) [ t - 1 ]
where {epsilon [ t ]} is a standard Gaussian white noise series.

From the data and the fitted model: rt[202] = 3.55584864407e-05 and sigma**2[202]= 4.92971353425e-
08. The one step ahead volatility forecast is then sigma**2[203]= 9.90283273138e-10.

The 99% quantile of the conditional distribution rt[203] | F[202] (given information at the previous step) is:
2.326 * sqrt(sigma**2[203]) = 7.31963511786e-05. Consequently, the 1%VaR of the next period horizon
given the last traded amount in our data was -126,074.00 USD (a short position):
VaR = 7.31963511786e-05 * 126,074.00 = 9.228156778490817 USD which is a small amount.

This IGARCH(1,1) model and VaR calculation using RiskMetrics methodology was implemented only for
illustrative purposes and may not be the best way to process the data in foreign exchange. Other models
may be more appropriate.

Vous aimerez peut-être aussi