Dear users,
I am trying to perform a MLE with a constrained parameter, and I would like to constrain beta2 = 1.3. However, when I run the code, it treats beta2 as an unconstrained parameter.
Here is my code:
I am trying to perform a MLE with a constrained parameter, and I would like to constrain beta2 = 1.3. However, when I run the code, it treats beta2 as an unconstrained parameter.
Here is my code:
Code:
set seed 11
clear
set obs 500
matrix define means = (0,0)
matrix define covar = (1, 0.5 \ 0.5, 1)
drawnorm x z, means(means) cov(covar)
gen y=1+1.2*x+1.5*z+2*rnormal()
mlexp (-0.5*ln({sigma2})-0.5*(y - {beta0}- x*{beta1} - z*{beta2=1.3})^2/{sigma2})

Comment