Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Solve module

    Thank to Kit Baum, the solve module is now up in SSC.

    This seeks a numeric solution of an equation of the form F(x) = y; that is, F is a real-valued function of one real variable.

    The function must be implemented as a rclass program, with the input being an option, and the output being a returned value. You also need to specify a search interval, and the function ought to be continuous in that interval (with some allowance for "holes" in the interval). The function may reference data, as long as it does not alter data that it might reference in a subsequent call.

    This uses the bisection method to seek the solution.

    Note that there already is a program with a similar purpose: mm_finvert, which is part of the moremata module, by Ben Jann. That, however, applies to Mata functions, whereas solve applies to functions implemented as Stata programs. Of course, one can cross over between Stata and Mata, using some programming tricks, but solve applies directly to Stata programs.

    Thanks again to Kit Baum for getting this uploaded, and for helping me in preparing it for release.
Working...
X