- #1
Cyn
- 8
- 0
Hi,
I want to program an GARCH model for exchange rates. To do this, I calculated the residuals. Next, I did the following (in python)
I get the following output:
[ 0.04881267 0.17925725 0.73315972]
Can anyone say if this is correct? Because I don't get the "usual" values for a GARCH model.
Thank you in advance!
I want to program an GARCH model for exchange rates. To do this, I calculated the residuals. Next, I did the following (in python)
Code:
def main():
vP0 = (0.1, 0.05, 0.92)
a = minimize(garch_loglike, vP0, eps, bounds = ((0.0001, None), (0.0001, None), (0.0001, None)), options={'disp':True})
print(a.x)
def garch_filter(omega, alpha, beta, eps):
iT = len(eps)
sigma_2 = np.zeros(iT)
for i in range(iT):
if i==0:
sigma_2[i] = omega/(1-alpha-beta)
else:
sigma_2[i] = omega + alpha*eps[i-1]**2 + beta*sigma_2[i-1]
return sigma_2def garch_loglike(vP, eps):
iT = len(eps)
omega = vP[0]
alpha = vP[1]
beta = vP[2]
sigma_2 = garch_filter(omega, alpha, beta, eps)
logL = -np.sum(-np.log(sigma_2) - eps**2/sigma_2)
return logL
I get the following output:
[ 0.04881267 0.17925725 0.73315972]
Can anyone say if this is correct? Because I don't get the "usual" values for a GARCH model.
Thank you in advance!