Search

Friends

Atomspheric CO2 (PPM)

Archives

Blather

Uptime verified by Wormly.com

15 January 2007

Stata and ‘ml init’

I've been using Stata's ml command for a while now. It's all quite nifty, but I couldn't figure out how to use the ml init part and I had a feeling that it would be a useful sort of command. When your likelihood function isn't globally concave there are no guarantees you're going to find the maximum you're looking for. The manual was pretty terse, and the book that explains it is $180 so I had just ignored it. But after running out of other options I started scouring the web for some example of it. And it's actually dead simple.

ml init beta:index=1 beta:_cons=0 /a=-4.566654 /b=-1.332323 /c=-0.54343

There is one equation and three parameters. All this command is saying that assume the coefficient on only regressor (mrw_index) is going to be in vicinity of 1 and the intercept in the vicinity of 0.

In this example the model failed to converge after 3 iterations with the hints and failed after 13 iterations without the hints. And that seems like a great improvement.

10 May 2006

Convergence

It's remarkable how exciting it can be just watching numbers trickle past and slowly converge.

26 April 2006

sysdir plus

I keep forgetting how to set the ado install path, when you don't have write access to the default path. This is it.

sysdir set PLUS youradopath

You'd use it if you get an error like this when you try to install new libraries:

could not rename c:\ado\plus\stata.trk to c:\ado\plus\backup.trk

31 March 2006

Problem with Stata’s leastlikely command

I found some issues with Stata's leastlikely command, so I fixed it up a bit. If you're getting issues with missing brackets, or failed to generate "Prob" or the error option outcome() not allowed then this will probably help. It's called leastlikely2, but you can rename it.

I also found that to give it a variable to put the probabilities into, you need to give it a previously generated variable.

gen pr = .
leastlikely2, generate(pr)

(more…)

0.077 seconds