I am using the ml command in Stata with mata-written likelihood evaluators.
Here, the likelihood evaluators include variables that do not appear in the equations in the ml command.
Specifically, consider the following mata-based evaluators
As you can see, the evaluator requires an extra variable z.
In this case, I am not sure how to use the input z in the ml model lf command.
How can I solve this problem?
Here, the likelihood evaluators include variables that do not appear in the equations in the ml command.
Specifically, consider the following mata-based evaluators
Code:
mata: void my_eval(transmorphic scalar ML, real rowvector b, real colvector lnf) { real vector depvar, xb, lnf depvar = moptimize_util_depvar(ML, 1) xb = moprimize_util_depvar(ML, b, 1) lnf = a function including depvar, xb, and z } end ml model lf my_eval() (depvar = xvar)
In this case, I am not sure how to use the input z in the ml model lf command.
How can I solve this problem?
Comment