APS Excellence in Physics Education Award
November 2019

Science SPORE Prize
November 2011

The Open Source Physics Project is supported by NSF DUE-0442581.

## Computational Physics Resources: Monte Carlo Integration & Importance Sampling Documents

This material has 6 associated documents. Select a document title to view a document's information.

#### Main Document

##### Computational Physics Resources: Monte Carlo Integration & Importance Sampling

written by Spencer Wheaton

This website contains a set of 2 simulations and accompanying worksheets that introduce the techniques of sample mean, hit and miss and importance sampling Monte Carlo integration.

This file is included in the full-text index.
This file has previous versions.

#### Supplemental Documents (3)

##### Hit and Miss and Sample Mean Methods Worksheet

A worksheet to accompany the EJS simulation MCIntegration No1 1DHitMissSampleMean.jar

This file is included in the full-text index.

##### Hit & Miss Sample Mean Model

The Hit & Miss Sample Mean Model investigates Monte Carlo integration techniques. The user is able to input a 1D integrand and finite integration limits and specify the number of trials and the number of separate runs.  The simulation allows the user to study the dependence of the uncertainty/error on the number of trials.

##### Monte Carlo Integration wiht Importance Sampling Model

The Monte Carlo Integration wiht Importance Sampling Model implements the sample mean and importance sampling techniques of Monte Carlo integration. The user can input a 1D integrand and finite integration limits and specify the required Monte Carlo technique or techniques.

The importance sampling technique requires the user to input a normalized probability distribution p(x) that matches the integrand in its main features, and an associated transformation law x(y) that converts a uniform y in [0,1) into an x sampled according to p(x). The simulation does perform a check on the normalization of p(x), but the result may be inaccurate for distributions defined over a very large interval or those with strange behavior.  The number of trials and the number of separate runs can be chosen by the user.

#### Source Code Documents (2)

##### Hit & Miss Sample Mean Source Code

The source code zip archive contains an XML representation of the Hit & Miss Sample Mean Model.  Unzip this archive in your EjsS 5 workspace to compile and run this model using EjsS 5 or above.