Monte Carlo Numerical Evaluation of a Definite Integral - Hit and Miss Method

Similar documents
Chapter 3 RANDOM VARIATE GENERATION

Density Curve. A density curve is the graph of a continuous probability distribution. It must satisfy the following properties:

Simulation Exercises to Reinforce the Foundations of Statistical Thinking in Online Classes

CHAPTER 6: Continuous Uniform Distribution: 6.1. Definition: The density function of the continuous random variable X on the interval [A, B] is.

Joint Exam 1/P Sample Exam 1

CHAPTER 7 INTRODUCTION TO SAMPLING DISTRIBUTIONS

AP Statistics Solutions to Packet 2

7 CONTINUOUS PROBABILITY DISTRIBUTIONS

16. THE NORMAL APPROXIMATION TO THE BINOMIAL DISTRIBUTION

Introduction to the Monte Carlo method

STATISTICS 8: CHAPTERS 7 TO 10, SAMPLE MULTIPLE CHOICE QUESTIONS

3.4 The Normal Distribution

A teaching experience through the development of hypertexts and object oriented software.

MATH 10: Elementary Statistics and Probability Chapter 5: Continuous Random Variables

The Procedures of Monte Carlo Simulation (and Resampling)

Lab 11. Simulations. The Concept

Math Quizzes Winter 2009

Introduction to Mobile Robotics Bayes Filter Particle Filter and Monte Carlo Localization

We discuss 2 resampling methods in this chapter - cross-validation - the bootstrap

Institute of Actuaries of India Subject CT3 Probability and Mathematical Statistics

Exercise 1.12 (Pg )

6.4 Normal Distribution

Assignment 2: Option Pricing and the Black-Scholes formula The University of British Columbia Science One CS Instructor: Michael Gelbart

AMS 5 CHANCE VARIABILITY

Descriptive Statistics

Data Preparation and Statistical Displays

Integration. Topic: Trapezoidal Rule. Major: General Engineering. Author: Autar Kaw, Charlie Barker.

5.3 Cell Phone Camera

Flood Risk Analysis considering 2 types of uncertainty

Week 4: Standard Error and Confidence Intervals

6 3 The Standard Normal Distribution

Back Analysis of Material Properties

Math 425 (Fall 08) Solutions Midterm 2 November 6, 2008

EXPERIMENTAL ERROR AND DATA ANALYSIS

Questions and Answers

Notes on Continuous Random Variables

z-scores AND THE NORMAL CURVE MODEL

Confidence Intervals for Cp

Data Analysis, Research Study Design and the IRB

Introduction. The Supplement shows results of locking using a range of smoothing parameters α, and checkerboard tests.

Descriptive Statistics

Chapter 9 Monté Carlo Simulation

Advanced Computer Graphics. Rendering Equation. Matthias Teschner. Computer Science Department University of Freiburg

MTH 140 Statistics Videos

Geostatistics Exploratory Analysis

A MONTE CARLO DISPERSION ANALYSIS OF A ROCKET FLIGHT SIMULATION SOFTWARE

MECHANICS OF SOLIDS - BEAMS TUTORIAL 2 SHEAR FORCE AND BENDING MOMENTS IN BEAMS

Summarizing and Displaying Categorical Data

ASCAT tandem coverage

Financial Mathematics and Simulation MATH Spring 2011 Homework 2

Summary of Formulas and Concepts. Descriptive Statistics (Ch. 1-4)

ENGINEERING SCIENCE H1 OUTCOME 1 - TUTORIAL 3 BENDING MOMENTS EDEXCEL HNC/D ENGINEERING SCIENCE LEVEL 4 H1 FORMERLY UNIT 21718P

EMPIRICAL FREQUENCY DISTRIBUTION

ATLAS Test Beam Analysis in Stockholm: An Overview

Capital Allocation and Bank Management Based on the Quantification of Credit Risk

Nonparametric statistics and model selection

Lego Robot Tutorials Touch Sensors

Model-based Synthesis. Tony O Hagan

ACCELERATION DUE TO GRAVITY

Risk Analysis and Quantification

AP STATISTICS REVIEW (YMS Chapters 1-8)

Programming Using Python

NCC5010: Data Analytics and Modeling Spring 2015 Practice Exemption Exam

GeoGebra Statistics and Probability

1) Write the following as an algebraic expression using x as the variable: Triple a number subtracted from the number

You flip a fair coin four times, what is the probability that you obtain three heads.

Statistics 151 Practice Midterm 1 Mike Kowalski

Confidence Intervals for One Standard Deviation Using Standard Deviation

An Introduction to Basic Statistics and Probability

Using a Log-normal Failure Rate Distribution for Worst Case Bound Reliability Prediction

THE BASICS OF STATISTICAL PROCESS CONTROL & PROCESS BEHAVIOUR CHARTING

ANALYSIS OF TREND CHAPTER 5

Confidence Intervals for Cpk

Reflection and Refraction

Simulation and Lean Six Sigma

VISUALIZATION OF DENSITY FUNCTIONS WITH GEOGEBRA

2.6. Probability. In general the probability density of a random variable satisfies two conditions:

Sample Term Test 2A. 1. A variable X has a distribution which is described by the density curve shown below:

Chapter 10. Key Ideas Correlation, Correlation Coefficient (r),

Calculator Notes for the TI-Nspire and TI-Nspire CAS

99.37, 99.38, 99.38, 99.39, 99.39, 99.39, 99.39, 99.40, 99.41, cm

Bootstrapping Big Data

Content Sheet 7-1: Overview of Quality Control for Quantitative Tests

Appendix 1: Time series analysis of peak-rate years and synchrony testing.

Building and Using Spreadsheet Decision Models

Normal Distribution as an Approximation to the Binomial Distribution

WISE Sampling Distribution of the Mean Tutorial

Lean Six Sigma Analyze Phase Introduction. TECH QUALITY and PRODUCTIVITY in INDUSTRY and TECHNOLOGY

CS 2750 Machine Learning. Lecture 1. Machine Learning. CS 2750 Machine Learning.

MACHINE LEARNING IN HIGH ENERGY PHYSICS

Schedule Risk Analysis Simulator using Beta Distribution

Distributed computing of failure probabilities for structures in civil engineering

A Simple Pseudo Random Number algorithm

Department of Civil Engineering-I.I.T. Delhi CEL 899: Environmental Risk Assessment Statistics and Probability Example Part 1

Lesson 1: Comparison of Population Means Part c: Comparison of Two- Means

SENSITIVITY ANALYSIS AND INFERENCE. Lecture 12

More details on the inputs, functionality, and output can be found below.

Exploratory Data Analysis

t Tests in Excel The Excel Statistical Master By Mark Harmon Copyright 2011 Mark Harmon

The Effects of Start Prices on the Performance of the Certainty Equivalent Pricing Policy

Transcription:

Monte Carlo Numerical Evaluation of a Definite Integral - Hit and Miss Method Created using Maple 14.1 Jake Bobowski "3-21-213, 21:32" (1) In all Monte Carlo simulations it is necessary to generate random or pseudo-random numbers. The following statement will generate a random number drawn from a uniform distribution between and 1..395718865 (2) To confirm that the numbers generated by X ( ) are uniformly distributed on the interval [,1], we can generate a long list of these numbers and plot a histogram.

1 Histogram 1 X This tutorial will attempt to numerically evaluate an integral for which the exact solution is easily obtained. This approach has been taken purposely so that we can confirm that our numerical techniques are reliable. The function that we will integrate is a simple polynomial. Below the function is plotted on the interval x =..1 and the exact value of the integral is evaluated over the same interval.

1 f(x) 1 x (3) The first method that we will implement is the Hit & Miss technique. In this method pairs of random numbers (x_i, y_i) will be generated. For the x-coordinate the x_i values will be between and 1 (the integration interval). Notice that our function of interest always lies between y=..1. Therefore, we will also restrict our y_i values to be between and 1. The randomly generated points (x_i, y_i) have equal probability of landing anywhere in the box which has area 1. The probability of a point landing beneath the function is equal to the area A beneath the curve (which is just the integral of the function of interest) divided by the area of the box. Therefore, if we can determine the probability of a point landing beneath the curve, we can easily approximate the value of the definite integral. The probability will be estimated simply by spraying n points into the box and counting how many land beneath the curve Zn (i.e. counting the Hits). Then the probability p is simply p = Zn / n.

f(x) 1 1 x

If you don't need to keep track of the actual hit and miss points and instead just count the number of hits Zn the calculation can be done more compactly and the loop will complete in a shorter time. Now we will numerically approximate the integral using n = 1 one hundred times and plot the resulting distribution of our determination of the integral. The distribution is expected to be Gaussian. WARNING: Depending on the machine that your working with, this chunk of could could take some time to fully execute! (4) "32:39" "37:31"

12 1 Definite Integral 8 6 4 2 Histogram The width of the distribution can be calculated from the standard deviation of the list of 1 approximations of the integral and is an estimate in the uncertainty of our determination of the definite integral..49994822964362 (5) Finally, the last thing we'll attempt to do is to understand how our uncertainly (standard deviation) depends on the n. So far, all of our calculations have used n = 1e3. Now we'll determine the standard deviation for values of n that range from 1 to 1e3. Again, this block of code could take some time to complete. It took my laptop about 9 minutes...

"37:31" 1 2 3 4 5 6 7 "46:31" (6) Below we plot the uncertainty in the numerical integral estimation as a function of n (the number of trials in the Monte Carlo simulation). As expected, the uncertainty decreases as the number of trials increases. The sigma values are proportional to 1/sqrt(n).

uncertainty 2 4 6 8 1 n To get a better appreciation of the dependence of sigma on n, below we plot sigma as a function of 1/sqrt(n) and observe the linear relationship between the two. Beautiful! All of this generated from uniformly distributed random numbers! Take a moment to reflect on what we've accomplished. We've used Monte Carlo simulations to study the behaviour of Monte Carlo simulations! The objective of a Monte Carlo calculation is always to study the characteristics of some system (often a physical system) by simulating data using random numbers.

uncertainty 1/sqrt(n)