I am using open source (Sandia Labs) OPT++ with newmat to model a GARCH(1,1) process. I need to estimate the parameters (omega, alpha, beta) which give the maximum likelihood. I have convinced myself that the likelihood function is correct. When I minimize (the negative) of the likelihood function without constraints it quickly goes to minus infinity as expected. I wish to implement the constraints
This requires modification
OPT++ has the capability to represent a constraint
The code throws the exception
It seems (from looking in the debugger) that a simplex search is being
set up and it's checking whether lower bounds are lower that upper bounds.
I suspect its a long shot that anyone has experienced this particular problem,
but I'm stuck trying to figure this out
Thanks and Cheers
K
Code:
0 < omega
0 < alpha + beta < 1
Code:
eps = 1.e-6
eps < omega < 1./eps
eps < alpha + beta < 1. - eps
Code:
double eps = 1.0e-6;
Matrix A(2,3);
A << 0. << 1. << 1.
<< 1. << 0. << 0.;
ColumnVector lower(2);
lower << eps << eps;
ColumnVector upper(2);
double upp1 = 1.0 - eps;
double upp2 = 1.0/eps;
upper << upp1 << upp2;
Constraint ineq = new LinearInequality(A, lower, upper);
CompoundConstraint cc(ineq);
// Nonlinear likelihood function
// with 3 params, and (linear? constraint)
NLF0 nlp(ndim, like, init_like, &cc);
// The search algorithm used in minimization of -likelihood
OptPDS objfcn(&nlp);
.
.
.
try {
objfcn.optimize();
}
// catch exceptions thrown by newmat
catch(BaseException) { cout << BaseException::what() << endl; }
catch(...) { cout << "exception caught in main program" << endl; }
Code:
An exception has been thrown
Logic error:- detected by Newmat: index error: requested index = 3
MatrixType = Rect # Rows = 2; # Cols = 1
set up and it's checking whether lower bounds are lower that upper bounds.
I suspect its a long shot that anyone has experienced this particular problem,
but I'm stuck trying to figure this out
Thanks and Cheers
K