This file is part of IDEAS, which uses RePEc data


[ Papers | Articles | Software | Books | Chapters | Authors | Institutions | JEL Classification | NEP reports | Search | New papers by email | Author registration | Rankings | Volunteers | FAQ | Blog | Help! ]

A generic function evaluator implemented in Mata

Author info | Abstract | Publisher info | Download info | Related research | Statistics
Author Info
Henrik Stovring () (University of Southern Denmark)
Abstract

When implementing new statistical procedures, there is often a need for simple--and yet computationally efficient--ways of numerically evaluating composite distribution functions. If the statistical procedure must support calculations for censored and noncensored cases, those calculations should be carried out using efficient computational implementations of both definite and indefinite integrals (e.g., calculation of tail areas of distribution functions). We developed a generic function evaluator such that users may specify a function using reverse Polish notation. As its argument the function evaluator takes a matrix of pointers and then applies the rows of this matrix to its internally defined stack of pointers. Accordingly, each row of the argument matrix defines a single operation such as evaluating a function on the current element of the stack, applying an algebraic operation to the two top elements of the stack, or manipulating the stack itself. Defining new composite distribution functions from other (atomic) distribution functions then corresponds to joining two or more function-defining matrices vertically. This approach can further be used to obtain integrals of any defined function. As an example we show how the density and distribution function for the minimum of two Weibull distributed random variables can be numerically evaluated and integrated. The procedure provides a flexible and extensible framework for imple- menting numerical evaluation of general, composite distributions. The procedure is numerically relatively efficient, although not optimal. Copyright 2007 by StataCorp LP.

Download Info
To download:

If you experience problems downloading a file, check if you have the proper application to view it first. Information about this may be contained in the File-Format links below. In case of further problems read the IDEAS help page. Note that these files are not on the IDEAS site. Please be patient as the files may be large.

File URL: http://www.stata-journal.com/article.html?article=pr0034
File Format:
File Function: link to article purchase
Download Restriction: no
File URL: http://www.stata-journal.com/software/sj7-4/pr0034/
File Format: text/html
File Function:
Download Restriction: no

Publisher Info
Article provided by StataCorp LP in its journal Stata Journal.

Volume (Year): 7 (2007)
Issue (Month): 4 (December)
Pages: 542-555
Download reference. The following formats are available: HTML (with abstract), plain text (with abstract), BibTeX, RIS (EndNote, RefMan, ProCite), ReDIF
Handle: RePEc:tsj:stataj:v:7:y:2007:i:4:p:542-555

Contact details of provider:
Web page: http://www.stata-journal.com/

Order Information:
Web: http://www.stata-journal.com/subscription.html

For technical questions regarding this item, or to correct its listing, contact: (Christopher F. Baum).

Related research
Keywords: rpnfcn(); RPN; Mata;

Statistics
Access and download statistics

Did you know? RePEc stands for Research Papers in Economics.

This page was last updated on 2009-10-27.


This information is provided to you by IDEAS at the Department of Economics, College of Liberal Arts and Sciences, University of Connecticut using RePEc data on a server sponsored by the Society for Economic Dynamics.