CSERD


  • userhome
  • catalog
  • resources
  • help

Monte Carlo Modeling


Shodor > CSERD > Resources > Algorithms > Monte Carlo Modeling

  


Monte Carlo Modeling

Function Integration

Some functions which are difficult to integrate by traditional methods can be handled by Monte Carlo methods. If you want to know the value of an integral of y(x) between a and b, and you know that y is bounded between 0 and h, you can take a series of N (x;random,yrandom) pairs at random from the space x>a, x<b, y>0, y<h. Let S be the number of (xrandom,yrandom) points for which yrandom<y(xrandom). The value of the integral will be the ratio of points within the integral times the total area sampled, or (S/N) * h * (b-a).

Modeling Stochastic Phenomena

Monte Carlo modeling and probability.

Stochastic phenomena are phenomena heavily influenced by random events. An example might be one's score in a game of darts. While skill is involved, randomness also plays a role. Many physical phenomena fit into this category.

Tracking the change in any dynamic system generally is done by one of two methods. The most common method (integration of differential equations) is to determine general properties of the system, to specify the rate of change over time, and to track the change in those general quantities over time. While a powerful tool computationally, this requires the system being solved to be easily represented by a few variables, and to not be strongly affected by random events. Monte Carlo modeling attempts to solve dynamic problems by tracking individual elements, in this case, individual predators and prey, and determining the occurence of key events (such as eating and being eaten) by evaluation of the probability of occurence of that event within a given time.

While more cumbersome computationally, this method not only allows us to deal with the effects of random events on a small population more realistically, but it also allows us to more easily track the change of traits within the population.

Modeling using known probabilities

The simplest method of Monte Carlo modeling involves cases where there is a known probability. Rolling dice, flipping coins, or spinning a spinner are examples. Often, however, determining the probability of an event occuring can be the difficult part of the problem, however, if you know the probability, and can compute a random number, you can build the model.

Modeling using timescales

An important parameter in many Monte Carlo model is the timescale for events to occur. The time scale is the "average" time between occurences. That means, that in a large population, that in a period of the "average" time, about half of the population will undergo the event in question. This is similar to another scientific quantity, half-life, and we can state the probability of the event occuring for an individual within the population during a period of time t as

P(t) = (1-(1/2)t/t1/2)

The mode progresses by stepping forward some time t, determining if an event has happened by evaluating the probability of the event occuring (on a scale of 0 to 1), producing a pseudo-random number between 0 and 1, and checking to see if the pseudo-random number is less than the probability of the event occuring.


©1994-2024 Shodor