Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: matrix of initial values in ml estimations

 From Maarten Buis To statalist@hsphsun2.harvard.edu Subject Re: st: matrix of initial values in ml estimations Date Tue, 10 Apr 2012 16:00:18 +0200

```On Tue, Apr 10, 2012 at 3:38 PM, Anisa Shyti wrote:
> I would like to test a series of initial values for my coefficient
> estimates in maximum likelihood.  For this particular estimation, I
> have two parameters, which values for both may fall in the range (0
> ,1).
>
> How can I define a matrix that tests for all the possible initial
> values (eg., 0.1, 0.2, 0.3, ...., 0.9) for both parameters?

The details depend on the exact program you are using but you'll
probably end up using a nested loop, e.g.

forvalues i = 1/9 {
forvalues j = 1/9 {
local a = `i'/10
local b = `j'/10
... , from( /a=`a' /b=`b') ...
}
}

Notice that it is generally good practice to code -forvalues i = 1/9-
and inside the loop divide `i' by 10 instead of -forvalues i =
0.1(0.1).9-. The reason is that a computer works in binary and in
binary the number 0.1 is like 1/3 in decimal.

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------
*
*   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/
```