Better visualization of the Metropolitan algorithm

Slides:



Advertisements
Similar presentations
Bayes rule, priors and maximum a posteriori
Advertisements

Class 02 Probability, Probability Distributions, Binomial Distribution.
October 1999 Statistical Methods for Computer Science Marie desJardins CMSC 601 April 9, 2012 Material adapted.
Physics 114: Lecture 9 Probability Density Functions Dale E. Gary NJIT Physics Department.
Chapter 7 Discrete Distributions. Random Variable - A numerical variable whose value depends on the outcome of a chance experiment.
1 Methods of Experimental Particle Physics Alexei Safonov Lecture #21.
CSC321: 2011 Introduction to Neural Networks and Machine Learning Lecture 10: The Bayesian way to fit models Geoffrey Hinton.
Descriptive statistics Experiment  Data  Sample Statistics Sample mean Sample variance Normalize sample variance by N-1 Standard deviation goes as square-root.
Prof. Bart Selman Module Probability --- Part d)
 Binomial distributions for sample counts  Binomial distributions in statistical sampling  Finding binomial probabilities  Binomial mean and standard.
Binomial Distributions Calculating the Probability of Success.
1 Bernoulli trial and binomial distribution Bernoulli trialBinomial distribution x (# H) 01 P(x)P(x)P(x)P(x)(1 – p)p ?
Section 6.3 Binomial Distributions. A Gaggle of Girls Let’s use simulation to find the probability that a couple who has three children has all girls.
P. STATISTICS LESSON 8.2 ( DAY 1 )
Binomial Experiment A binomial experiment (also known as a Bernoulli trial) is a statistical experiment that has the following properties:
COMP 170 L2 L17: Random Variables and Expectation Page 1.
Week 21 Conditional Probability Idea – have performed a chance experiment but don’t know the outcome (ω), but have some partial information (event A) about.
1 Since everything is a reflection of our minds, everything can be changed by our minds.
7.2 Means and variances of Random Variables (weighted average) Mean of a sample is X bar, Mean of a probability distribution is μ.
40S Applied Math Mr. Knight – Killarney School Slide 1 Unit: Statistics Lesson: ST-5 The Binomial Distribution The Binomial Distribution Learning Outcome.
1 Parrondo's Paradox. 2 Two losing games can be combined to make a winning game. Game A: repeatedly flip a biased coin (coin a) that comes up head with.
Discrete Distributions. Random Variable - A numerical variable whose value depends on the outcome of a chance experiment.
Warm Up Section Explain why the following is not a valid probability distribution? 2.Is the variable x discrete or continuous? Explain. 3.Find the.
Psychology 202a Advanced Psychological Statistics September 29, 2015.
Bernoulli Trials, Geometric and Binomial Probability models.
Diversity Loss in General Estimation of Distribution Algorithms J. L. Shapiro PPSN (Parallel Problem Solving From Nature) ’06 BISCuit 2 nd EDA Seminar.
Section 6.3 Day 1 Binomial Distributions. A Gaggle of Girls Let’s use simulation to find the probability that a couple who has three children has all.
Discrete Random Variable Random Process. The Notion of A Random Variable We expect some measurement or numerical attribute of the outcome of a random.
Understanding the Mean How can we display data? Since this data is not symmetric, it is harder to determine the mean. Between what two numbers would be.
Binomial Distributions
Induction in Pascal’s Triangle
Discrete Distributions
Jiaping Wang Department of Mathematical Science 04/22/2013, Monday
MAT 446 Supplementary Note for Ch 3
Scientific Notation.
Negative Binomial Experiment
Repetition Structures
Tutorial 9 EM and Beta distribution
The hypergeometric distribution/ Fisher exact test
Bayesian approach to the binomial distribution with a discrete prior
STATISTICS AND PROBABILITY IN CIVIL ENGINEERING
Physics 114: Lecture 7 Probability Density Functions
BASIC PROBABILITY Probability – the chance of something (an event) happening # of successful outcomes # of possible outcomes All probability answers must.
Bayes Net Learning: Bayesian Approaches
Chapter Randomness, Probability, and Simulation
Elementary Statistics
Means and Variances of Random Variables
Chapter 16.
Probability And Expected Value ————————————
Module 4 Loops.
Introduction to Artificial Intelligence Lecture 11: Machine Evolution
Warm Up Imagine a family has three children. 1) What is the probability the family has: 3 girls and 0 boys 2 girls and 1 boy 1 girl and 2 boys 0 girls.
Discrete Distributions
Probability And Expected Value ————————————
Discrete Distributions
Lecture 2 Binomial and Poisson Probability Distributions
Expected values and variances
Discrete Distributions.
Solving Linear Equations
Discrete Distributions
Randomness, Probability, and Simulation
Binomial Distributions
Fun… Tree Diagrams… Probability.
Statistics and Probability-Part 5
Review of the Binomial Distribution
Further Topics on Random Variables: 1
MAS2317- Introduction to Bayesian Statistics
Mathematical Foundations of BME Reza Shadmehr
Homework Due Tomorrow mrsfhill.weebly.com.
Presentation transcript:

Better visualization of the Metropolitan algorithm The negative binomial distribution

Plot every 100 iterations… Everything is as before except the graph is now in the loop https://github.com/afodor/metagenomicsTools/blob/master/src/metropolitan/realTimeGraphUpdates.txt

With this updated code, we can watch the posterior form in “real time”

These constants are chosen so the integral sums to one…. One last prior to consider (to again watch the prior belief melt away with new data….) These constants are chosen so the integral sums to one…. lapply applies our function to every element in the vector https://github.com/afodor/metagenomicsTools/blob/master/src/metropolitan/realTimeGraphUpdates.txt

It is trivial to make this our new prior…

As is the case for the exponential prior, with enough steps, we find our posterior… Notice the slight discontinuity left from our prior…

Better visualization of the Metropolitan algorithm The negative binomial distribution

You enter a tournament You can play until you have 3 losses. Your rate of winning games is 60%. What is the distribution of your expected number of wins? This is the negative binomial distribution… (This is also the tournament structure of the arena in Hearthstone, but I digress…)

The negative binomial distribution: The # of wins (k) before we see r losses…. There are k wins r losses prob = p is the probability of a loss K = # of wins … r = # of losses before you are dropped from the tournament P = 0.4 = prob(loss) (so the probability of win = 0.6) The probability of each individual sequence of wins and losses is Since the last game must be a loss, there are ways of organizing the “flips”

Here we simulate 10,000 tournaments https://github.com/afodor/metagenomicsTools/blob/master/src/classExamples/simDist/negativeBinomial.txt

R, of course, has this distribution built in…

We state without proof for the negative binomial distribution: Mean = (1-p) * r (1-p) * r Variance = p p *p Let’s say p =0.4 and r = 3. The expected number of wins is: .6 * 3 / 4 = 4.5 The variance associated with those wins is: .6 * 3 / (.4*.4) =11.25 So for a player who wins 60% of the games, mean +- SD = 4.5 +- 3.4 (To convert to the Wiki’s formulas, replace p with 1-p; we will stick with R’s notation in the class)

The reason the negative binomial distribution is the most popular algorithm for sequence count data in genomics…. If you know the mean and variance, you can calculate p and r… (We also state this without proof…) Mean # of wins variance p = 4.5 / 11.25 = 0.4 r = 4.5*4.5 / (11.25-4.5) = 3 So knowing the mean and the variance is the same as knowing r and p. In the Dseq paper, for each gene, we can estimate the mean and the variance. Then we can use a test based on the negative binomial distribution!

Using the negative binomial distribution gives us another free parameter to play with! Relaxes the assumption that mean == variance Allows us a better fit to the data than the Poisson (or binomial) distribution. More on this next time…

So if we are going to use the negative binomial, we have to define In the negative binomial distribution, the variance is always greater than the mean So if we are going to use the negative binomial, we have to define the variance as the mean plus something… http://www.johndcook.com/negative_binomial.pdf

has a different variance…. In comparing the binomial and the negative binomial, we see that the negative binomial has a different variance…. Dbinom = flip the fair coin 20 times and count the heads Dnbinom = flip the coin until you get 10 tails and count the heads… https://github.com/afodor/metagenomicsTools/blob/master/src/classExamples/negativeBinomialExamples.txt