monte carlo integration l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Monte Carlo Integration PowerPoint Presentation
Download Presentation
Monte Carlo Integration

Loading in 2 Seconds...

play fullscreen
1 / 31

Monte Carlo Integration - PowerPoint PPT Presentation


  • 263 Views
  • Uploaded on

Monte Carlo Integration. Robert Lin April 20, 2004. Outline. Integration Applications Random variables, probability, expected value, variance Integration Approximation Monte Carlo Integration Variance Reduction (sampling methods). Integration Applications. Antialiasing.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Monte Carlo Integration' - albert


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
monte carlo integration

Monte Carlo Integration

Robert Lin

April 20, 2004

outline
Outline
  • Integration Applications
  • Random variables, probability, expected value, variance
  • Integration Approximation
  • Monte Carlo Integration
  • Variance Reduction (sampling methods)
integration applications5
Integration Applications
  • Indirect Lighting
random variables probability density function
Random Variables, Probability Density Function
  • Continuous random variable x:

scalar or vector quantity that randomly takes on a value (-∞,+∞)

  • Probability Density Function p associated with x (denoted x ~ p) describes the distribution of x:
  • Properties:
random variables probability density function7
Random Variables, Probability Density Function
  • Example:

Let ε be a random variable taking on values [0, 1) uniformly

  • Probability Density Function ε~ q
  • Probability that ε takes on a certain value [a, b] in [0, 1) is
expected value
Expected Value
  • The average value of a function f(x) with probability distribution function (pdf) p(x) is called the expected value:
  • The expected value of a 1D random variable can be calculated by letting f(x) = x.
  • Expected Value Properties:

1.

2.

multidimensionality
Multidimensionality
  • Random variables and expected values can be extended to multiple dimensions easily
  • Let S represent a multidimensional space with measure μ
  • Let x be a random variable with pdf p
  • Probability that x takes on a value in region in Si, a subset of S, is
multidimensionality10
Multidimensionality
  • Example:
    • Let α be a 2D random variable uniformly distributed on a disk of radius R
    • p(α) = 1 / (πR2)
multidimensionality11
Multidimensionality
  • Example
    • Given a unit square S = [0, 1] x [0, 1]
    • Given pdf p(x, y) = 4xy
    • The expected value of the x coordinate is found by setting f(x, y) = x:
variance
Variance
  • The variance of a random variable is defined as the expected value of the square of the difference between x and E(x).
  • Some algebra lets us convert this to the form:
integration problems
Integration Problems
  • Integrals for rendering can be difficult to evaluate
    • Multi-dimensional integrals
    • Non-continuous functions
      • Highlights
      • Occluders
integration approximation
Integration Approximation
  • How to evaluate integral of f(x)?
integration approximation15
Integration Approximation
  • Can approximate using another function g(x)
integration approximation16
Integration Approximation
  • Can approximate by taking the average value
integration approximation17
Integration Approximation
  • Estimate the average by taking N samples
monte carlo integration18
Monte Carlo Integration
  • Im = Monte Carlo estimate
  • N = number of samples
  • x1, x2, …, xN are uniformly distributed random numbers between a and b
monte carlo integration20
Monte Carlo Integration
  • We have the definition of expected value and how to estimate it.
  • Since the expected value can be expressed as an integral, the integral is also approximated by the sum.
  • To simplify the integral, we can substitute g(x) = f(x)p(x).
variance21
Variance
  • The variance describes how much the sampled values vary from each other.
  • Variance proportional to 1/N
variance22
Variance
  • Standard Deviation is just the square root of the variance
  • Standard Deviation proportional to 1 / sqrt(N)
  • Need 4X samples to halve the error
variance23
Variance
  • Problem:
    • Variance (noise) decreases slowly
    • Using more samples only removes a small amount of noise
variance reduction
Variance Reduction
  • There are several ways to reduce the variance
    • Importance Sampling
    • Stratified Sampling
    • Quasi-random Sampling
    • Metropolis Random Mutations
importance sampling
Importance Sampling
  • Idea: use more samples in important regions of the function
  • If function is high in small areas, use more samples there
importance sampling26
Importance Sampling
  • Want g/p to have low variance
  • Choose a good function p similar to g:
stratified sampling
Stratified Sampling
  • Partition S into smaller domains Si
  • Evaluate integral as sum of integrals over Si
  • Example: jittering for pixel sampling
  • Often works much better than importance sampling in practice
conclusion
Conclusion
  • Monte Carlo Integration Pros
    • Good to estimate integrals with many dimensions
    • Good to estimate integrals with complex functions
    • General integration method with many applications
  • Monte Carlo Integration Cons
    • Variance reduces slowly (error appears as noise)
    • Reduce variance with importance sampling, stratified sampling, etc.
    • Can use other methods (filtering) to remove noise
references
References
  • Peter Shirley, R. Keith Morley. Realistic Ray Tracing, Natick, MA: A K Peters, Ltd., 2003, pages 47-51, 145-154.
  • Henrik Wann Jensen. Realistic Image Synthesis Using Photon Mapping, Natick, MA: A K Peters, Ltd., 2001, pages 153-155.
  • Pat Hanrahan. Monte Carlo Integration 1 (Lecture Notes): http://graphics.stanford.edu/courses/cs348b-02/lectures/lecture6
  • Thomas Funkhouser, Monte Carlo Integration For Image Synthesis: http://www.cs.princeton.edu/courses/archive/fall02/cs526/lectures/montecarlo.pdf
  • Eric Veach. Robust Monte Carlo Methods for Light Transport Simulation. Ph.D Thesis, Stanford University, Dec 1997.