Correct fmincon() constraints for GARCH?

6 views (last 30 days)
Michael Ziedalski
Michael Ziedalski on 14 Feb 2018
Answered: Hang Qian on 16 Feb 2018
Hello, all. So, I am trying to manually to MLE estimate a GARCH(1,1) model using the optimization toolbox's fmincon(). I know that Matlab's built-in garch() has constraints in its optimization, such as briefly mentioned in this mathworks doc, but I do not know how to manually by myself express these by myself as fmincon arguments.
My code so far is this, which works for unconstrained optimization using fminunc/ fminsearch:
lh = @(x,data) -sum(log(fun(x,data))); %Transformation of my input function for optimization.
options = optimset('Display', 'off', 'MaxIter', 1000000, 'TolX', 10^-20, 'TolFun', 10^-20);
[theta, max1] = fmincon(@(x) lh(x,data), guesses, options, constraints???);
The guide for fmincon() is not clearing things up, how I code these constraints myself?

Answers (1)

Hang Qian
Hang Qian on 16 Feb 2018
Hi Michael,
Typically we add some inequality constraints to ensure a positive conditional variance in the GARCH(1,1) model, like constant > 0, arch > 0, garch > 0 and arch + garch < 1.
The numeric optimization function fmincon supports inequality constraints. Since the constraints are linear, we can put them in a matrix form like A * x < b. If the parameters are stacked like [constant, garch, arch], then the constraints can be formulated as
A = [0 1 1]
b = 1
lb = [0 0 0]
Then we can run the constrained optimization using the syntax
fmincon(fun,x0,A,b,[],[],lb,[],[],options)
where the empty matrix [] indicates non-existing constraints of other types.
By the way, we may replace lb by an augmented A and b with more rows, but it is not as efficient as the explicit lower bounds.
Best,
Hang Qian

Categories

Find more on Conditional Variance Models in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!