Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.
﻿

>  Docs Center  >  IDL Reference  >  Advanced Math and Stats  >  IMSL_RANDOM_NPP

IMSL_RANDOM_NPP

# IMSL_RANDOM_NPP

The IMSL_RANDOM_NPP function generates pseudorandom numbers from a nonhomogeneous Poisson process.

Routine IMSL_RANDOM_NPP simulates a one-dimensional nonhomogeneous Poisson process with rate function theta in a fixed interval (tend - tbegin).

Let Î»(t) be the rate function and t0 = tbegin and t1 = tend. Routine IMSL_RANDOM_NPP uses a method of thinning a nonhomogeneous Poisson process {N*(t), t â¥ t0} with rate function Î»*(t) â¥ Î»(t) in (t0, t1), where the number of events, N*, in the interval (t0, t1) has a Poisson distribution with parameter:

The function:

is called the integrated rate function. In IMSL_RANDOM_NPP, Î»*(t) is taken to be a constant Î»*(= theta_max) so that at time ti, the time of the next event ti + 1 is obtained by generating and cumulating exponential random numbers:

with parameter Î»*, until for the first time:

where the uj,i are independent uniform random numbers between 0 and 1. This process is continued until the specified number of events, neub, is realized or until the time, tend, is exceeded. This method is due to Lewis and Shedler (1979), who also review other methods. The most straightforward (and most efficient) method is by inverting the integrated rate function, but often this is not possible.

If theta_max is actually greater than the maximum of Î»(t) in (t0, t1), the routine will work, but less efficiently. Also, if Î»(t) varies greatly within the interval, the efficiency is reduced. In that case, it may be desirable to divide the time interval into subintervals within which the rate function is less variable. This is possible because the process is without memory.

If no time horizon arises naturally, tend must be set large enough to allow for the required number of events to be realized. Care must be taken, however, that ftheta is defined over the entire interval.

After simulating a given number of events, the next event can be generated by setting tbegin to the time of the last event (the sum of the elements in the result) and calling IMSL_RANDOM_NPP again. Cox and Lewis (1966) discuss modeling applications of nonhomogeneous Poisson processes.