Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • optimize() versus moptimize() with d2 evaluator



    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!
    Alfonso Sanchez-Penalver

  • #2
    Alfonso Sánchez-Peñalver did you ever get a response to this question? I also seem to be having a problem which might require some non-linear optimization and I am stuck not knowing where to begin. It has to do with estimating the parameters m and r as in this example. Got some information that the d2 evaluator might work but that is the much I know. How I make it work is a little confusing to me. Think you can help?
    Click image for larger version

Name:	Dominitz.png
Views:	1
Size:	305.4 KB
ID:	1624340

    Comment

    Working...
    X