All problems
GARCH(1,1) Variance Update
Problem
Update the conditional variance of a GARCH(1,1) model: sigma2_new = omega + alpha * e^2 + beta * sigma2, where e is the latest innovation and sigma2 the previous conditional variance.
Return the updated variance.
Hint
Persistence is alpha + beta; large shocks raise next period's variance.
Test cases
case 1
in: [0.1,0.1,0.8,4,1]
expected: 1.3
case 2
in: [0.2,0.3,0.5,1,2]
expected: 1.5
case 3
in: [0,0,0,5,5]
expected: 0
case 4
in: [0.1,0.2,0.7,0,0]
expected: 0.1
Starter codePython
def garch11_update(omega, alpha, beta, e2, sigma2):
# Your code here
pass4 test cases · run your code against them in the editor