# Maximum Likelihood Estimation in Stata

• May 6th 2010, 08:03 AM
Maximum Likelihood Estimation in Stata
Hey,
i have a set of data consisting of three variables x1, x2 and x3 with N observations. I want to estimate a relationship between these by using a translog function equal to zero. (i do NOT have a dependent variable y). Thus, the problem is formulated as:

$
0 = \beta_0 + \beta_1 \log x_1 + \beta_2 \log x_2 + \beta_3 \log x_3 + \frac{1}{2}\beta_4 \log x_1^2 + \frac{1}{2}\beta_5 \log x_1 \log x_2 +$

$
\frac{1}{2}\beta_6 \log x_1 \log x_3 + \frac{1}{2}\beta_7 \log x_2^2 + \frac{1}{2}\beta_8 \log x_2 \log x_3 + \frac{1}{2}\beta_9 \log x_3^3 + \epsilon
$

I have tried to implement this in Stata by assuming that the error term is standard normal with mean 0 and stdev 1. By solving the above equation for epsilon and maximizing the log-likelihood one gets:

$
\log L = \sum_i^N \log \phi(\epsilon)
$

where $\phi$ is the standard normal density function. I've tried to solve this in stata by using the following program:

------
program myprog
version 11
args lnf epsilon
quietly replace lnf' = log(normalden(epsilon'))
end
------

ml model lf myprog (all independent variables here)

ml maximize
------

I get the error message: "could not calculate numerical derivatives -- discontinuous region with missing values encountered"

It probably has something to do with me not specifying any \$ML_y1, but I cant get my head around this problem when y=0 in my regression! Does anyone have a clue?