Professional Documents
Culture Documents
Monte Carlo Integration in Excel
Monte Carlo Integration in Excel
Excel
Integration
Who integrating can be calculated:
If y=x
Then the graph representation of this equation will be as follow:
y
If we want to for example to find the area under this carve when starting from
x=0 to 2 (note y=x) then only way to do that is to use the integral :
Monte Carlo Integration
Another way for calculated the integration function:
f(x)
x
B
y
f(x)
x
B
y
f(x)
x
B
B N below
0
f ( x)dx AB
N total
Setting up Excel Spreadsheet
• Random Number Generator
– Rand()*(b-a)+a
• Generate a number between a and b
• The “Status”
– If(X<f(X), “below”, “above”)
• If value of f(X) > Y then mark “below”
• The “Count”
– If(Status=“below”,1,0)
• If value of status is “below” then count a “hit”
• Making sense of data
– Take total number of hits and divide by total number of points to
find fraction under function
– Multiply calculated fraction by area of “box” to find the area under
the curve.
Setting up Excel Spreadsheet