Hi
I am trying to estimate a finite mixture model with multiple equations by maximum likelihood.
I use Moptimize to find the optimum of the likelihood function.
The model takes the following form
The u's are actually mass-points (a serie of constants) related to their counterpart equations containing the b's.
u1 are for example the mass-points for equation 1.
Although the paremeters for the u's have no covariates they form one group of parameters (in terms of the logic of the model).
Is it possible to treat this vector of parameters as an equation and to supply a fake matrice of
covariates which has the same number of columns as the parameter vector in order to trick moptimize?
Will it affect the way the numerical gradient and hessian are computed?
I want to avoid to loop over all the elements of u1 in order to feed the initial values and supply u1
once instead.
I am thinking of the following code
I use Stata 14.1 on Windows 2008 server.
Best
Christophe
I am trying to estimate a finite mixture model with multiple equations by maximum likelihood.
I use Moptimize to find the optimum of the likelihood function.
The model takes the following form
equation | parameters | covariates | # of parameters |
1 | b1 | X1 | k1 |
2 | u1 | l1 | |
3 | b2 | X2 | k2 |
4 | u2 | l2 | |
5 | prob. associated with the u's |
The u's are actually mass-points (a serie of constants) related to their counterpart equations containing the b's.
u1 are for example the mass-points for equation 1.
Although the paremeters for the u's have no covariates they form one group of parameters (in terms of the logic of the model).
Is it possible to treat this vector of parameters as an equation and to supply a fake matrice of
covariates which has the same number of columns as the parameter vector in order to trick moptimize?
Will it affect the way the numerical gradient and hessian are computed?
I want to avoid to loop over all the elements of u1 in order to feed the initial values and supply u1
once instead.
I am thinking of the following code
Code:
u1 = .... // initial values eq = 1 moptimize_init_eq_cons(M,eq,"off") moptimize_init_eq_indepvars(M,eq,J(1,cols(u1),0)) moptimize_init_eq_coefs(M,eq,u1)
I use Stata 14.1 on Windows 2008 server.
Best
Christophe
Comment