Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Stas Kolenikov <skolenik@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: mata optimize problem |
Date | Sat, 3 Jul 2010 13:08:47 -0500 |
set matalnum on to see which line of your procedure generates the error. To make your program well defended against bad inputs, you can code something like if ( cols(A_inv) != rows( X ) ) { printf( "{err}A_inv is not conformant to X"\n) lndensity[,] = J( rows(lndensity), 1, . ) return } Note also that your observations lie on the straight line x==y. A more sensible set of values might have been gen xcoor = uniform() gen ycoor = uniform() producing points distribution U[0,1]^2.