Announcement

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

  • Declaration for moptimize

    To implement an ML estimation, I used the moptimize command.
    Specifically, the code looks like below:
    Code:
    :function llk (transmorphic M, real rowvector b, real colvector lnf) {
            .
            .
            .
    }
    
    :M = moptimize_init()
    :moptimize_init_evaluator(M, &llk())
     .
     .
     .
    :moptimize(M)
    I am now building a Stata command that utilizes the MLE results.
    But, I am not sure what type is appropriate for the object "M" above.

    For example, in my Mata command, I have to extract a subset of the estimation results as below:
    Code:
    : beta = moptimize_result_coefs(M)[1 .. 3]
    When I try to use this command, Mata says that I have to declare the type of M.
    But, I cannot find a guide for the object M.
    So, what is the object type of M that comes from moptimize_init()?

  • #2
    I found that the object M should be transmorphic, and now my command perfectly works with a globally accessible evaluator function llk().

    Comment

    Working...
    X