Aptech Systems, Inc. Worldwide Headquarters
Aptech Systems, Inc.
2350 East Germann Road, Suite #21
Chandler, AZ 85286
Ready to Get Started?
Request Quote & Product Information
Training & Events
Step-by-step, informative lessons for those who want to dive into GAUSS and achieve their goals, fast.
Have a Specific Question?
Q&A: Register and Login
Premier Support and Platinum Premier Support are annually renewable membership programs that provide you with important benefits including technical support, product maintenance, and substantial cost-saving features for your GAUSS System or the GAUSS Engine.
Join our community to see why our users are considered some of the most active and helpful in the industry!
Where to Buy
Recent Tagsapplications character vectors CML CMLMT Constrained Optimization datasets dates dlibrary dllcall error error handling errors Excel file i/o floating network GAUSS Engine graphics GUI hotkeys installation Java API license licensing linux loading data loops matrices matrix matrix manipulation Maxlik MaxLikMT Memory optimization Optmum output PQG graphics procs RAM random numbers string functions strings structures threading Time Series writing data
Time Series 2.0 MT
Find out more now
Time Series MT 2.1
How do I set the 'ind' input to my objective function with COMT
I’m trying to write an objective function when using COMT. The inputs to my function are supposed to be like this:
proc fct(struct PV p, struct DS d, ind)
My question is how to assign value to the third inputs ‘ind’. Is it through comtControl?
The way that COMT and the other GAUSS optimization packages work is that the main GAUSS procedure, in this case comt, calls your objective function. You will not call it directly.
The third input to your objective function for COMT is an indicator vector, ind. You do not ever set this input. This indicator vector is a way for COMT to tell you what it wants you to compute.
If the first element of ind is nonzero, COMT needs you to compute the value of your objective function at the parameter values that it passes in. If the second element of ind is nonzero, then COMT would like you to calculate the gradient. If the third element of ind is nonzero, then COMT would like you to calculate the hessian. For example:
proc (1) = logLik(struct PV p, struct DS d, ind); struct modelResults mm; if ind; mm.function = //compute log-likelihood endif; if ind; mm.gradient = //optionally compute first derivative endif; if ind; mm.hessian = //optionally computer second derivative endif; retp(mm); endp;
Your problem will converge more quickly and with higher accuracy if you can supply code to compute the first and second derivative of your function. However, it is not required. If you do not calculate the derivatives when indicated by the ind input, COMT will simply calculate them numerically.
I think this explanation will answer your question, but you should also take a look at the section discussing the ind input to the likelihood function in chapter 3 of the COMT manual.