SlideShare une entreprise Scribd logo
1  sur  23
Monte Carlo Methods
~Theory and Applications~
Michael Bell
Initial Assumptions
We have a computational means of generating
random numbers.
We will handle only cases in which P(x) can be
evaluated for all possible x in the domain.
We know some basic mathematics.
(calculus, statistics, algebra)
We want to perform high dimensional integration
(without lengthy/impossible calculations)
The Challenge of Sampling P(x)
We wish to sample
Problem 1: We usually don't know the constant Z
Problem 2: If we know Z, how do we draw the
samples (in higher dimensions)?
P(x)=
ˇP(x)
Z
The Curse of Dimensionality
Determine the normalization constant
Now add more parameters... :(
Uniform Sampling
We can't feasibly sample everywhere in the
parameter space.
Instead, let's try to find it by drawing random
samples.
The Procedure
1) Draw random samples uniformly from
parameter space
2) Evaluate P*(x) at those points.
3) Evaluate
4) Estimate E[x] by ZR=∑
r=1
R
f (x
(r)
)
ˇP(x
(r)
)
ZR
ZR=∑
r=1
R
ˇP(x(r)
)
Great...but it still sucks.
If P(x) is uniform, this method will work very well.
However, for a nonuniform distribution the
probability is typically confined to a small volume
within the parameter space. Hence we will require
a large number of samples making this method
essentially useless.
What will we do?!
It's a bird...
it's a plane...
it's a series of various
MONTE CARLO METHODS
Single Dimensional
Algorithms/Procedures
Importance Sampling
Rejection Sampling
Metropolis-Hastings Method
Goals
Generate random samples from a distribution
To estimate the expectation of functions under
such a distribution
sing the estimator:
^E [x]=
1
R
∑
r
f (x
(r)
)
E [x]=⟨f (x)⟩≡∫P (x)f (x)dx1...dxn
{x(r )
}r=1
R
Why should you care?
We can write the variance as:
The variance will decrease as Var[X]/R
The accuracy of this method is independent of the
dimensionality of the space sampled.
Var(x)=⟨⟨f (x)⟩−f (x)⟩2
∫P( x)f (x)⟨⟨f (x)⟩−f (x)⟩2
dx1...dxn
Importance Sampling
When P(x) is too complicated, we can choose an
alternative “proposal” density, Q(x).
1) Generate R samples from Q(x).
2) Weight them according to their “importance”
(i.e. their value relative to P(x))
3) Evaluate the Estimator
wr ≡
ˇP(x)
ˇQ (x)
^E[x]=
∑ wr f (x
(r)
)
∑ wr
Rejection Sampling
Again, we choose a proposal density, Q(x).
1) Determine a constant, c, such that
2) Generate a random number x from Q(x).
3) Evaluate and generate a uniformly
distributed sample, u, in the interval
4) Evaluate
5) accept if u < reject if u >
∀ x,c ˇQ (x)> ˇP(x)
c ˇQ(x)
[0,c ˇQ(x)]
ˇP(x)
ˇP(x) ˇP(x)
Metropolis-Hastings Method
What if we can't find a “nice” proposal density?
Instead, generate random samples from an
“evolving” proposal density that more closely
approximates P(x) with each additional sample.
This implies the need for an iterative process,
which will require a Markov Chain (hence MCMC).
Metropolis-Hastings Algorithm
Let f(x) be proportional to the desired P(x)
Choose an arbitrary first sample, x, and an arbitrary
density Q(x|y) (typically a Gaussian)
For each iteration:
1) Generate a candidate x' from Q(x|y).
2) Calculate the acceptance ratio a=f(x')/f(x).
3) If a>1, calculate a=f(x'')/f(x') and so on.
4) If a<1, generate another candidate x' from Q(x|y).
A Summary of the Algorithms
We can implement Monte Carlo Methods on any
distribution, P(x), that can be expressed as
Each converts integrals to sums as
∫f (x)P(x)dx=
1
R
∑
r
f (x
(r)
)
P(x)=
ˇP(x)
Z
An Elementary Application
TASK: Estimate Pi Using a Monte Carlo Method
Throw N of darts at a unit square.
(Randomly sample [0,1]x[0,1])
Count a “throw” as a “hit” if the sample lies within
a quarter unit circle.
Area of quarter unit circle = pi/4
pi/4~(hits/throws)
pi~4*(hits/throws)
Rejection Sampling Python Code
from random import random
from math import sqrt
darts = 10000000
hits = 0
throws = 0
for I in range (1,darts):
throws += 1
x = random()
y = random()
dist = sqrt(x*x+y*y)
if dist <= 1.0:
hits += 1
pi = 4*(hits/throws)
print “pi = %s” %(pi)
Rejection Sampling Code Results
Estimates
3.1419759142
3.1419711413
3.1420311142
Avg. Estimate
3.1417680475
Real Value:
3.1415926535
The Ising Model (Magnetization)
Goal: Minimize the energy
(i.e. the hamiltonian)
Note: the energy is lower when
spins are aligned.
We will use the mean field (nearest
neighbor) approximation
Ising MCMC Implementation
Ising MCMC Implementation
Results
FYI: Results taken from website:
http://farside.ph.utexas.edu/teaching/329/lectures/nod
Given sufficient testing, this is what we'd find.

Contenu connexe

Tendances

Monte carlo simulation
Monte carlo simulationMonte carlo simulation
Monte carlo simulationMissAnam
 
Binomial distribution good
Binomial distribution goodBinomial distribution good
Binomial distribution goodZahida Pervaiz
 
Introduction to simulation modeling
Introduction to simulation modelingIntroduction to simulation modeling
Introduction to simulation modelingbhupendra kumar
 
Interval Estimation & Estimation Of Proportion
Interval Estimation & Estimation Of ProportionInterval Estimation & Estimation Of Proportion
Interval Estimation & Estimation Of ProportionDataminingTools Inc
 
Monte Carlo Simulations
Monte Carlo SimulationsMonte Carlo Simulations
Monte Carlo Simulationsgfbreaux
 
Monte Carlo Simulation
Monte Carlo SimulationMonte Carlo Simulation
Monte Carlo SimulationAguinaldo Flor
 
Introduction to Maximum Likelihood Estimator
Introduction to Maximum Likelihood EstimatorIntroduction to Maximum Likelihood Estimator
Introduction to Maximum Likelihood EstimatorAmir Al-Ansary
 
Cramer row inequality
Cramer row inequality Cramer row inequality
Cramer row inequality VashuGupta8
 
Point Estimate, Confidence Interval, Hypotesis tests
Point Estimate, Confidence Interval, Hypotesis testsPoint Estimate, Confidence Interval, Hypotesis tests
Point Estimate, Confidence Interval, Hypotesis testsUniversity of Salerno
 
Chapter 18 sensitivity analysis
Chapter 18   sensitivity analysisChapter 18   sensitivity analysis
Chapter 18 sensitivity analysisBich Lien Pham
 
Binomial probability distribution
Binomial probability distributionBinomial probability distribution
Binomial probability distributionMuhammad Yahaya
 
Introduction to Optimization.ppt
Introduction to Optimization.pptIntroduction to Optimization.ppt
Introduction to Optimization.pptMonarjayMalbog1
 
Optimization Methods
Optimization MethodsOptimization Methods
Optimization Methodsmetamath
 
3. eng. cost and estimation
3. eng. cost and estimation3. eng. cost and estimation
3. eng. cost and estimationMohsin Siddique
 
Binomial distribution
Binomial distributionBinomial distribution
Binomial distributionSonamWadhwa3
 
Queuing theory and its applications
Queuing theory and its applicationsQueuing theory and its applications
Queuing theory and its applicationsDebasisMohanty37
 

Tendances (20)

Monte carlo simulation
Monte carlo simulationMonte carlo simulation
Monte carlo simulation
 
Binomial distribution good
Binomial distribution goodBinomial distribution good
Binomial distribution good
 
Introduction to simulation modeling
Introduction to simulation modelingIntroduction to simulation modeling
Introduction to simulation modeling
 
Monte carlo simulation
Monte carlo simulationMonte carlo simulation
Monte carlo simulation
 
Moment Generating Functions
Moment Generating FunctionsMoment Generating Functions
Moment Generating Functions
 
Interval Estimation & Estimation Of Proportion
Interval Estimation & Estimation Of ProportionInterval Estimation & Estimation Of Proportion
Interval Estimation & Estimation Of Proportion
 
Monte Carlo Simulations
Monte Carlo SimulationsMonte Carlo Simulations
Monte Carlo Simulations
 
Monte Carlo Simulation
Monte Carlo SimulationMonte Carlo Simulation
Monte Carlo Simulation
 
Introduction to Maximum Likelihood Estimator
Introduction to Maximum Likelihood EstimatorIntroduction to Maximum Likelihood Estimator
Introduction to Maximum Likelihood Estimator
 
Cramer row inequality
Cramer row inequality Cramer row inequality
Cramer row inequality
 
Point Estimate, Confidence Interval, Hypotesis tests
Point Estimate, Confidence Interval, Hypotesis testsPoint Estimate, Confidence Interval, Hypotesis tests
Point Estimate, Confidence Interval, Hypotesis tests
 
Chapter 18 sensitivity analysis
Chapter 18   sensitivity analysisChapter 18   sensitivity analysis
Chapter 18 sensitivity analysis
 
Binomial probability distribution
Binomial probability distributionBinomial probability distribution
Binomial probability distribution
 
Introduction to Optimization.ppt
Introduction to Optimization.pptIntroduction to Optimization.ppt
Introduction to Optimization.ppt
 
Optimization Methods
Optimization MethodsOptimization Methods
Optimization Methods
 
3. eng. cost and estimation
3. eng. cost and estimation3. eng. cost and estimation
3. eng. cost and estimation
 
Probability
ProbabilityProbability
Probability
 
Binomial distribution
Binomial distributionBinomial distribution
Binomial distribution
 
Queuing theory and its applications
Queuing theory and its applicationsQueuing theory and its applications
Queuing theory and its applications
 
Bootstrap.ppt
Bootstrap.pptBootstrap.ppt
Bootstrap.ppt
 

En vedette

Particle Filters and Applications in Computer Vision
Particle Filters and Applications in Computer VisionParticle Filters and Applications in Computer Vision
Particle Filters and Applications in Computer Visionzukun
 
Monte carlo simulation
Monte carlo simulationMonte carlo simulation
Monte carlo simulationAnurag Jaiswal
 
An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...
An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...
An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...NTNU
 
History of Mathematics
History of MathematicsHistory of Mathematics
History of Mathematicstmp44
 
Monte Carlo Simulation Methods
Monte Carlo Simulation MethodsMonte Carlo Simulation Methods
Monte Carlo Simulation Methodsioneec
 
Strata 2013: Tutorial-- How to Create Predictive Models in R using Ensembles
Strata 2013: Tutorial-- How to Create Predictive Models in R using EnsemblesStrata 2013: Tutorial-- How to Create Predictive Models in R using Ensembles
Strata 2013: Tutorial-- How to Create Predictive Models in R using EnsemblesIntuit Inc.
 

En vedette (7)

Particle Filters and Applications in Computer Vision
Particle Filters and Applications in Computer VisionParticle Filters and Applications in Computer Vision
Particle Filters and Applications in Computer Vision
 
Monte carlo simulation
Monte carlo simulationMonte carlo simulation
Monte carlo simulation
 
An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...
An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...
An Importance Sampling Approach to Integrate Expert Knowledge When Learning B...
 
Particle Filter
Particle FilterParticle Filter
Particle Filter
 
History of Mathematics
History of MathematicsHistory of Mathematics
History of Mathematics
 
Monte Carlo Simulation Methods
Monte Carlo Simulation MethodsMonte Carlo Simulation Methods
Monte Carlo Simulation Methods
 
Strata 2013: Tutorial-- How to Create Predictive Models in R using Ensembles
Strata 2013: Tutorial-- How to Create Predictive Models in R using EnsemblesStrata 2013: Tutorial-- How to Create Predictive Models in R using Ensembles
Strata 2013: Tutorial-- How to Create Predictive Models in R using Ensembles
 

Similaire à Monte Carlo Methods

Discussion about random variable ad its characterization
Discussion about random variable ad its characterizationDiscussion about random variable ad its characterization
Discussion about random variable ad its characterizationGeeta Arora
 
Maximum likelihood estimation of regularisation parameters in inverse problem...
Maximum likelihood estimation of regularisation parameters in inverse problem...Maximum likelihood estimation of regularisation parameters in inverse problem...
Maximum likelihood estimation of regularisation parameters in inverse problem...Valentin De Bortoli
 
Probability Formula sheet
Probability Formula sheetProbability Formula sheet
Probability Formula sheetHaris Hassan
 
random variables-descriptive and contincuous
random variables-descriptive and contincuousrandom variables-descriptive and contincuous
random variables-descriptive and contincuousar9530
 
Testing for mixtures by seeking components
Testing for mixtures by seeking componentsTesting for mixtures by seeking components
Testing for mixtures by seeking componentsChristian Robert
 
Appendex b
Appendex bAppendex b
Appendex bswavicky
 
Chapter 3 – Random Variables and Probability Distributions
Chapter 3 – Random Variables and Probability DistributionsChapter 3 – Random Variables and Probability Distributions
Chapter 3 – Random Variables and Probability DistributionsJasonTagapanGulla
 
2 random variables notes 2p3
2 random variables notes 2p32 random variables notes 2p3
2 random variables notes 2p3MuhannadSaleh
 
Stochastic Differentiation
Stochastic DifferentiationStochastic Differentiation
Stochastic DifferentiationSSA KPI
 
Numarical values
Numarical valuesNumarical values
Numarical valuesAmanSaeed11
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlightedAmanSaeed11
 
Probability and Statistics
Probability and StatisticsProbability and Statistics
Probability and StatisticsMalik Sb
 
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)Dahua Lin
 

Similaire à Monte Carlo Methods (20)

talk MCMC & SMC 2004
talk MCMC & SMC 2004talk MCMC & SMC 2004
talk MCMC & SMC 2004
 
PhysicsSIG2008-01-Seneviratne
PhysicsSIG2008-01-SeneviratnePhysicsSIG2008-01-Seneviratne
PhysicsSIG2008-01-Seneviratne
 
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
 
Discussion about random variable ad its characterization
Discussion about random variable ad its characterizationDiscussion about random variable ad its characterization
Discussion about random variable ad its characterization
 
Maximum likelihood estimation of regularisation parameters in inverse problem...
Maximum likelihood estimation of regularisation parameters in inverse problem...Maximum likelihood estimation of regularisation parameters in inverse problem...
Maximum likelihood estimation of regularisation parameters in inverse problem...
 
QMC: Operator Splitting Workshop, Using Sequences of Iterates in Inertial Met...
QMC: Operator Splitting Workshop, Using Sequences of Iterates in Inertial Met...QMC: Operator Splitting Workshop, Using Sequences of Iterates in Inertial Met...
QMC: Operator Splitting Workshop, Using Sequences of Iterates in Inertial Met...
 
Probability Formula sheet
Probability Formula sheetProbability Formula sheet
Probability Formula sheet
 
A bit about мcmc
A bit about мcmcA bit about мcmc
A bit about мcmc
 
random variables-descriptive and contincuous
random variables-descriptive and contincuousrandom variables-descriptive and contincuous
random variables-descriptive and contincuous
 
Testing for mixtures by seeking components
Testing for mixtures by seeking componentsTesting for mixtures by seeking components
Testing for mixtures by seeking components
 
Appendex b
Appendex bAppendex b
Appendex b
 
Chapter 3 – Random Variables and Probability Distributions
Chapter 3 – Random Variables and Probability DistributionsChapter 3 – Random Variables and Probability Distributions
Chapter 3 – Random Variables and Probability Distributions
 
2 random variables notes 2p3
2 random variables notes 2p32 random variables notes 2p3
2 random variables notes 2p3
 
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
 
Stochastic Differentiation
Stochastic DifferentiationStochastic Differentiation
Stochastic Differentiation
 
Numarical values
Numarical valuesNumarical values
Numarical values
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlighted
 
Probability and Statistics
Probability and StatisticsProbability and Statistics
Probability and Statistics
 
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)
Appendix to MLPI Lecture 2 - Monte Carlo Methods (Basics)
 
Mcgill3
Mcgill3Mcgill3
Mcgill3
 

Dernier

Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)
Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)
Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)Joonhun Lee
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.Nitya salvi
 
Dopamine neurotransmitter determination using graphite sheet- graphene nano-s...
Dopamine neurotransmitter determination using graphite sheet- graphene nano-s...Dopamine neurotransmitter determination using graphite sheet- graphene nano-s...
Dopamine neurotransmitter determination using graphite sheet- graphene nano-s...Mohammad Khajehpour
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Monika Rani
 
COMPUTING ANTI-DERIVATIVES (Integration by SUBSTITUTION)
COMPUTING ANTI-DERIVATIVES(Integration by SUBSTITUTION)COMPUTING ANTI-DERIVATIVES(Integration by SUBSTITUTION)
COMPUTING ANTI-DERIVATIVES (Integration by SUBSTITUTION)AkefAfaneh2
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .Poonam Aher Patil
 
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...dkNET
 
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Unit5-Cloud.pptx for lpu course cse121 o
Unit5-Cloud.pptx for lpu course cse121 oUnit5-Cloud.pptx for lpu course cse121 o
Unit5-Cloud.pptx for lpu course cse121 oManavSingh202607
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)Areesha Ahmad
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPirithiRaju
 
STS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATION
STS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATIONSTS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATION
STS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATIONrouseeyyy
 
Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Silpa
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICEayushi9330
 
Zoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdfZoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdfSumit Kumar yadav
 
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...ssuser79fe74
 
Introduction,importance and scope of horticulture.pptx
Introduction,importance and scope of horticulture.pptxIntroduction,importance and scope of horticulture.pptx
Introduction,importance and scope of horticulture.pptxBhagirath Gogikar
 
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedConnaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
module for grade 9 for distance learning
module for grade 9 for distance learningmodule for grade 9 for distance learning
module for grade 9 for distance learninglevieagacer
 

Dernier (20)

Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)
Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)
Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
 
Dopamine neurotransmitter determination using graphite sheet- graphene nano-s...
Dopamine neurotransmitter determination using graphite sheet- graphene nano-s...Dopamine neurotransmitter determination using graphite sheet- graphene nano-s...
Dopamine neurotransmitter determination using graphite sheet- graphene nano-s...
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
 
COMPUTING ANTI-DERIVATIVES (Integration by SUBSTITUTION)
COMPUTING ANTI-DERIVATIVES(Integration by SUBSTITUTION)COMPUTING ANTI-DERIVATIVES(Integration by SUBSTITUTION)
COMPUTING ANTI-DERIVATIVES (Integration by SUBSTITUTION)
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
dkNET Webinar "Texera: A Scalable Cloud Computing Platform for Sharing Data a...
 
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
 
Unit5-Cloud.pptx for lpu course cse121 o
Unit5-Cloud.pptx for lpu course cse121 oUnit5-Cloud.pptx for lpu course cse121 o
Unit5-Cloud.pptx for lpu course cse121 o
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
 
STS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATION
STS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATIONSTS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATION
STS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATION
 
Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
 
Clean In Place(CIP).pptx .
Clean In Place(CIP).pptx                 .Clean In Place(CIP).pptx                 .
Clean In Place(CIP).pptx .
 
Zoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdfZoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdf
 
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
 
Introduction,importance and scope of horticulture.pptx
Introduction,importance and scope of horticulture.pptxIntroduction,importance and scope of horticulture.pptx
Introduction,importance and scope of horticulture.pptx
 
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedConnaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
 
module for grade 9 for distance learning
module for grade 9 for distance learningmodule for grade 9 for distance learning
module for grade 9 for distance learning
 

Monte Carlo Methods

  • 1. Monte Carlo Methods ~Theory and Applications~ Michael Bell
  • 2. Initial Assumptions We have a computational means of generating random numbers. We will handle only cases in which P(x) can be evaluated for all possible x in the domain. We know some basic mathematics. (calculus, statistics, algebra) We want to perform high dimensional integration (without lengthy/impossible calculations)
  • 3. The Challenge of Sampling P(x) We wish to sample Problem 1: We usually don't know the constant Z Problem 2: If we know Z, how do we draw the samples (in higher dimensions)? P(x)= ˇP(x) Z
  • 4. The Curse of Dimensionality Determine the normalization constant Now add more parameters... :(
  • 5. Uniform Sampling We can't feasibly sample everywhere in the parameter space. Instead, let's try to find it by drawing random samples.
  • 6. The Procedure 1) Draw random samples uniformly from parameter space 2) Evaluate P*(x) at those points. 3) Evaluate 4) Estimate E[x] by ZR=∑ r=1 R f (x (r) ) ˇP(x (r) ) ZR ZR=∑ r=1 R ˇP(x(r) )
  • 7. Great...but it still sucks. If P(x) is uniform, this method will work very well. However, for a nonuniform distribution the probability is typically confined to a small volume within the parameter space. Hence we will require a large number of samples making this method essentially useless. What will we do?!
  • 8. It's a bird... it's a plane... it's a series of various MONTE CARLO METHODS
  • 10. Goals Generate random samples from a distribution To estimate the expectation of functions under such a distribution sing the estimator: ^E [x]= 1 R ∑ r f (x (r) ) E [x]=⟨f (x)⟩≡∫P (x)f (x)dx1...dxn {x(r ) }r=1 R
  • 11. Why should you care? We can write the variance as: The variance will decrease as Var[X]/R The accuracy of this method is independent of the dimensionality of the space sampled. Var(x)=⟨⟨f (x)⟩−f (x)⟩2 ∫P( x)f (x)⟨⟨f (x)⟩−f (x)⟩2 dx1...dxn
  • 12. Importance Sampling When P(x) is too complicated, we can choose an alternative “proposal” density, Q(x). 1) Generate R samples from Q(x). 2) Weight them according to their “importance” (i.e. their value relative to P(x)) 3) Evaluate the Estimator wr ≡ ˇP(x) ˇQ (x) ^E[x]= ∑ wr f (x (r) ) ∑ wr
  • 13. Rejection Sampling Again, we choose a proposal density, Q(x). 1) Determine a constant, c, such that 2) Generate a random number x from Q(x). 3) Evaluate and generate a uniformly distributed sample, u, in the interval 4) Evaluate 5) accept if u < reject if u > ∀ x,c ˇQ (x)> ˇP(x) c ˇQ(x) [0,c ˇQ(x)] ˇP(x) ˇP(x) ˇP(x)
  • 14. Metropolis-Hastings Method What if we can't find a “nice” proposal density? Instead, generate random samples from an “evolving” proposal density that more closely approximates P(x) with each additional sample. This implies the need for an iterative process, which will require a Markov Chain (hence MCMC).
  • 15. Metropolis-Hastings Algorithm Let f(x) be proportional to the desired P(x) Choose an arbitrary first sample, x, and an arbitrary density Q(x|y) (typically a Gaussian) For each iteration: 1) Generate a candidate x' from Q(x|y). 2) Calculate the acceptance ratio a=f(x')/f(x). 3) If a>1, calculate a=f(x'')/f(x') and so on. 4) If a<1, generate another candidate x' from Q(x|y).
  • 16. A Summary of the Algorithms We can implement Monte Carlo Methods on any distribution, P(x), that can be expressed as Each converts integrals to sums as ∫f (x)P(x)dx= 1 R ∑ r f (x (r) ) P(x)= ˇP(x) Z
  • 17. An Elementary Application TASK: Estimate Pi Using a Monte Carlo Method Throw N of darts at a unit square. (Randomly sample [0,1]x[0,1]) Count a “throw” as a “hit” if the sample lies within a quarter unit circle. Area of quarter unit circle = pi/4 pi/4~(hits/throws) pi~4*(hits/throws)
  • 18. Rejection Sampling Python Code from random import random from math import sqrt darts = 10000000 hits = 0 throws = 0 for I in range (1,darts): throws += 1 x = random() y = random() dist = sqrt(x*x+y*y) if dist <= 1.0: hits += 1 pi = 4*(hits/throws) print “pi = %s” %(pi)
  • 19. Rejection Sampling Code Results Estimates 3.1419759142 3.1419711413 3.1420311142 Avg. Estimate 3.1417680475 Real Value: 3.1415926535
  • 20. The Ising Model (Magnetization) Goal: Minimize the energy (i.e. the hamiltonian) Note: the energy is lower when spins are aligned. We will use the mean field (nearest neighbor) approximation
  • 23. Results FYI: Results taken from website: http://farside.ph.utexas.edu/teaching/329/lectures/nod Given sufficient testing, this is what we'd find.