Hi,
I wanted to pick your brains about optimize() versus moptimize() to use with maximum likelihood problems. I have very little experience with them, which is why I'm starting this post, and what I can infer is that moptimize() basically provides you many useful extras when you have a linear form optimization problem. It also provides a useful function to display the results without having to exit to Stata.
When you need to have a d2 evaluator, however, these additional tools are not useful. In particular, I am talking about about setting a cluster variable in the hope of getting the cluster-robust estimator of the variance. Creating a function to get the robust and cluster robust variance matrices is not hard once you have the optimal parameter vector and Hessian. The problem seems to be that there is no way you can change the result variance in the optimization object, so there seems to be no way to display the appropriate results with moptimize(), which begs the question of whether we should consider using it when we don't have a simple linear form problem.
Is there any way to display the results from optimize()? Or a function to display results, given a coefficient vector and a variance matrix from within Mata? Because that would be very useful. If not, is there a function to post results to e() from Mata by providing the coefficient vector and variance matrix from within Mata? Otherwise, is there a way to pass the strip names with the vector/matrix when passing it to Stata?
Besides answering my questions I would really like to hear your input on optimize() versus moptimize() when problems are beyond linear form problems.
Thanks!
Comment