Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: mata optimize problem


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.



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index