# Re: st: vector of independent variables in ML program

 From "Stas Kolenikov" To statalist@hsphsun2.harvard.edu Subject Re: st: vector of independent variables in ML program Date Tue, 12 Aug 2008 08:47:41 -0500

```A big idea of -ml- is that you don't have to do that, as the
derivatives with respect to beta's necessary for likelihood
maximization and variance estimation will be computed by the chain
rule. If all that your equations depend on is theta, then you don't
really need to go into x's. The book on [ML] will explain all the
details (http://www.stata.com/bookstore/mle.html), and if you write
your own -ml- code, that book is a must.

On Tue, Aug 12, 2008 at 8:29 AM, Jonathan Hanson
<johanson@maxwell.syr.edu> wrote:
> Greetings,
>
> How does one refer to a vector of independent variables from within an ML
> program?  For example, suppose I need to write a gradient vector, the
> formula for which looks something like this:
>
> ∂ ln L/ ∂ Β =  (1/sigma^2) x'(y - xΒ)
>
> where x' is a k by 1 vector of the independent variables for an observation.
>  I know that I can refer to y as \$ML_y1 and xB as one of the arguments
> (theta, for instance), but how can I call x' in the formula?  Ultimately, I
> will have multiple equations in this formula, so I need to be able to
> specify equation from which the x's are coming.
>
> Many thanks,
>
>
>
> Jonathan Hanson
> Assistant Professor of Political Science
> Maxwell School of Citizenship and Public Affairs
> 100 Eggers Hall
> Syracuse University
> Syracuse, NY 13244
>
>
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

--
Stas Kolenikov, also found at http://stas.kolenikov.name
Small print: I use this email account for mailing lists only.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```