Statalist


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

Re: st: Finding the roots (zeros) of an equation with stata


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: Finding the roots (zeros) of an equation with stata
Date   Tue, 9 Jun 2009 16:13:28 +0000 (GMT)

> On Tue, Jun 9, 2009 at 4:46 PM, Nathan Danneman wrote:
> > I would like to find the roots of complex univariate
> > expressions, such as y=x^3+2x^2-5.

--- On Tue, 9/6/09, Tirthankar Chakravarty wrote:
> /* begin */
> clear*
> mata
> polyroots((-5, 0, 2, 1))
> end
> /* end */

If your expression is not a polynomial you can look
at Ben Jann's -moremata- package, and in particular
his -mm_root()- and -mm_nrroot()- commands.

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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