Functions for Monte Carlo integration with stratified antithetic sampling with rpnfcn()
Command name Argument
These functions are to be used with rpnfcn(). The functions &MCatnode(), &MCatwt(), &tlMCatnode(), and &tlMCatwt() compute nodes and weights for numerical integration based on Monte Carlo with stratified antithetic sampling. The function &intres() computes the result by summing the evaluated nodes multiplied with the weights.
&MCatnode() and &tlMCatnode() use the argument vector ab and a, respectively, to set up the nodes based on the matrix of uniformly distributed random variables presumed to be in the current top element of the stack in rpnfcn(). The number of columns of the matrix of uniformly distributed random variables equals the number of strata used in the integration, thus precision is improved when the number of columns is increased. ab must be a matrix with two columns specifying the lower and upper boundary of the integration interval, respectively, while a must be a column vector specifying the lower boundary for the indefinite integral.
Henrik StÝvring, Research Unit of General Practice, University of Southern Denmark. Please email email@example.com if you have comments, questions or observe any problems.
Manual: [M] Mata Reference Manual
Online: help for [M-0] mata, Evaluation of algorithm matrix using RPN, RPN stack manipulation functions, RPN binary operators, RPN distribution functions,