Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Mata Numerical Precision


From   "Frank Michael Kunz" <[email protected]>
To   [email protected]
Subject   st: Mata Numerical Precision
Date   Wed, 15 Aug 2007 16:35:58 -0400 (EDT)

Hello Statalisters,

This (long) question involves numerical precision in Mata. Specifically, I
know to use quadcross (and quadcolsum etc )rather than X'X etc.

I'd like to know if Stata 10 found a solution to making + and - more
precise (i.e. quad precision). Have others developed methods to make
numerical maximization routines run more precise in Mata?

More specifically:

I am using Stata version 9 and I am migrating a program from Gauss over
into Mata and an ado file. Its a non-linear least squares estimation
command for count data with endogeneity (treatment variable governed by a
probit model), multiple stages.

As you know, when you are doing a newton-raphson or gradient like
maximization routine, you program a loop and have a command like this:

B= B0 - (INV_HESSIAN*GRADIENT)

And since this model involves nonlinearities, the formuala for the Hessian
is fairly complicated, it involves liberal use of :* and (Tx-1):* a
matrix.

I find that, using the same data, a maximization routine that gauss
finished in 8 iterations takes Stata/Mata something like 300 iterations.

So, I think that imprecision is the "root" of the problem.

Any feedback greatly appreciated.

Yours,

Michael Kunz



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index