Statalist


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

Re: st: re: generating a sequence of numbers in Mata


From   "Le Wang" <[email protected]>
To   [email protected]
Subject   Re: st: re: generating a sequence of numbers in Mata
Date   Mon, 1 Oct 2007 21:30:08 -0500

Kit,

Thanks again!

Le

On 10/1/07, Kit Baum <[email protected]> wrote:
> Le Wang wonders why his Mata routine comes up one short some of the
> time. Just the usual finite-precision-arithmetic problem: remember
> that 0.1 is an irrational number in binary, so that adding it up 19
> times does not necessarily give you exactly 1.90. Replace the line
> computing the number of points with
>
>        n=ceil((to-from)/increment) +1 /* Number of points*/
>
> and it should work.
>
>
> Kit Baum, Boston College Economics and DIW Berlin
> http://ideas.repec.org/e/pba1.html
> An Introduction to Modern Econometrics Using Stata:
> http://www.stata-press.com/books/imeus.html
>
>
> *
> *   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/
>


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Le Wang, Ph.D.
Minnesota Population Center
University of Minnesota
(o) 612-624-5818
*
*   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