Hi,
I am trying to jointly estimate two equations using moptimize, but I am having some troubles.
Let's say that my log likelihood function is llf=llf1+llf2, where 1 and 2 denote the first and the second equation, respectively.
The second equation employs a set of covariates, let's say X2, and a covariate Z=f(beta1hat) that is a function of the estimated coefficients in equation 1.
Inside the evaluator gf0, I specify the independent variables of the second equation as:
(Z(beta1hat),moptimize_util_xb(M, b, 2))
where moptimize_util_xb represents X2.
If I remove Z(beta1hat) from the independent variables of the second equation, I can jointly estimate llf.
However, if I use Z(), I have a "conformability error". Note that I am sure that my definition of Z() is correct since I used it in a two-step estimator procedure without any problem.
Any help is greatly appreciated.
Many thanks.
Simone
I am trying to jointly estimate two equations using moptimize, but I am having some troubles.
Let's say that my log likelihood function is llf=llf1+llf2, where 1 and 2 denote the first and the second equation, respectively.
The second equation employs a set of covariates, let's say X2, and a covariate Z=f(beta1hat) that is a function of the estimated coefficients in equation 1.
Inside the evaluator gf0, I specify the independent variables of the second equation as:
(Z(beta1hat),moptimize_util_xb(M, b, 2))
where moptimize_util_xb represents X2.
If I remove Z(beta1hat) from the independent variables of the second equation, I can jointly estimate llf.
However, if I use Z(), I have a "conformability error". Note that I am sure that my definition of Z() is correct since I used it in a two-step estimator procedure without any problem.
Any help is greatly appreciated.
Many thanks.
Simone
Comment