1 / 28

Lesson 3: Choosing from distributions

Lesson 3: Choosing from distributions. Choosing from distributions Discrete (Review) Continuous: Direct (Review) Continuous: Rejection Probability mixing Metropolis method Stratified sampling. Overview of pdf and cdf (Review). Basic definition of probability density function ( p.d.f .):

clariced
Download Presentation

Lesson 3: Choosing from distributions

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lesson 3: Choosing from distributions • Choosing from distributions • Discrete (Review) • Continuous: Direct (Review) • Continuous: Rejection • Probability mixing • Metropolis method • Stratified sampling

  2. Overview of pdf and cdf (Review) • Basic definition of probability density function (p.d.f.): • And its integral, the cumulative distribution function (c.d.f.):

  3. Overview of pdf and cdf (2) • Corollaries of these definitions:

  4. Mapping x->x using p(x) • Our basic technique is to use a unique y->x • y=x from (0,1) and x from (a,b) • We are going to use the mapping backwards

  5. Mapping (2) Note that: • x(a)=0 • x(b)=1 • Function is non-decreasing over domain (a,b) Our problem reduces to: • Finding x(x) • Inverting to get x(x), a formula for turning pseudo-random numbers into numbers distributed according to desired p(x)

  6. Mapping (3) • We must have:

  7. Resulting general procedure • Form CDF: • Set equal to pseudo-random number: • Invert to get formula that translates from x to x:

  8. Uniform distribution • For our first distribution, pick x uniformly in range (a,b): • Step 1: Form CDF.

  9. Uniform distribution (2) • Step 2: Set pseudo-random number to CDF: • Step 3: Invert to get x(x): • Example: Choose m uniformly in (-1,1):

  10. Discrete distribution • For a discrete distribution, we have N choices of state i, each with probability , so: • Step 1: Form CDF:

  11. Discrete distribution (2) • Step 2: Set pseudo-random number to CDF: • Step 3: Invert to get x(x):

  12. Discrete distribution (3) • Example: Choose among 3 states with relative probabilities of 4, 5, and 6.

  13. Continuous distribution: Direct • This fits the “pure” form developed before. • Form CDF: • Set equal to pseudo-random number: • Invert to get formula that translates from x to x:

  14. Continuous: Direct (2) • Example: Pick x from:

  15. Testing your selection • There are two simple ways to check a routine that is used to choose from a given distribution: binning or moments • Binning involves dividing the domain (or part of it) into (usually equal-sized) regions and then counting what fraction of chosen values fall in the region. • The expected answer for a bin that goes from a to b is • This will be approximately equal to (and close enough for our purposes) the midpoint value times the width: • The text notes (and Public area) have a Java routine that will perform a bin testing • Hint: Do NOT code this with a IF test for each bin. Instead use the integer value of (chosen value)/(total width)*(number of bins)+1 to identify the bin that x goes into.

  16. Continuous: Rejection • Basis of rejection approach: Usual procedure (using a flat x distribution): • Find a value • Choose • Keep iff Otherwise, return to 1.

  17. Continuous: Rejection (3) • Example: Use rejection to pick x from:

  18. Basic idea of probability mixing • Situations arise in which you have multiple distributions involved in a single decision:

  19. Probability mixing procedure • Real problems do not present themselves so cleanly and you have to figure it out:

  20. Probability mixing procedure (2) Procedure: • Form and normalize the • Choose the distribution i using these

  21. Probability mixing procedure (3) Procedure: • Form the p.d.f. for distribution i: • Choose using

  22. Probability mixing procedure (3) Example:Use probability mixing to select x from:

  23. Metropolis • This is a very non-intuitive procedure that falls under the category of Markov Chain MC • It will ULTIMATELY deliver a consistent series of x’s distributed according to a desired functional form (which does NOT have to be normalized nor do you need to know a maximum value) • It has many advantages for certain physical problems in which the relative probability of a chosen point can be determined even if a closed form of the PDF is not available • The main disadvantage is that it is very hard to tell when the procedure has “settled in” to the point that the stream of x’s can be trusted to deliver a consistent distribution • This method was (supposedly) worked out as part of an after-dinner conversation in Los Alamos after WWII

  24. Metropolis (2) • In its simplest form, the procedure is: • Choose x according to a distribution that has certain properties. We will not go into the details except to say that a uniform distribution has all the properties. • Evaluate the PDF at the chosen x • Decide whether to use the new point according to these rules: • IF the PDF evaluates higher than the PREVIOUSLY chosen point’s PDF, then use the new x • IF the PDF evaluates less than the previous point’s PDF, then pull another random number between 0 and 1 • If the new random number is LESS than the ratio of (new point’s PDF)/(old point’s PDF), then use the new x • If the previous test fails, then REUSE the old x

  25. “Other”: Two alternate • Choose x from using: • Choose x from (Gaussian/normal) using: (Why 12?)

  26. Homework from text

  27. Homework from text

  28. Homework from text

More Related