Joint Probability Distributions, Correlations

Similar documents
Joint Probability Distributions, Correlations

Multivariate Distributions CIVL 7012/8012

Continuous Probability Distributions. Uniform Distribution

Lecture 2: Repetition of probability theory and statistics

Continuous Probability Distributions. Uniform Distribution

Ch. 5 Joint Probability Distributions and Random Samples

Bivariate distributions

Descriptive statistics: Sample mean and variance

Algorithms for Uncertainty Quantification

Lecture 16 : Independence, Covariance and Correlation of Discrete Random Variables

Chapter 5 Joint Probability Distributions

Chapter 5 continued. Chapter 5 sections

MA/ST 810 Mathematical-Statistical Modeling and Analysis of Complex Systems

Random Signals and Systems. Chapter 3. Jitendra K Tugnait. Department of Electrical & Computer Engineering. Auburn University.

Chapter 2. Some Basic Probability Concepts. 2.1 Experiments, Outcomes and Random Variables

Lecture Notes 1 Probability and Random Variables. Conditional Probability and Independence. Functions of a Random Variable

Multivariate Random Variable

Chapter 2. Probability

Joint Distribution of Two or More Random Variables

Joint Probability Distributions and Random Samples (Devore Chapter Five)

Probability Models. 4. What is the definition of the expectation of a discrete random variable?

Notes 12 Autumn 2005

Lecture Notes 1 Probability and Random Variables. Conditional Probability and Independence. Functions of a Random Variable

Learning Objectives for Stat 225

Math Review Sheet, Fall 2008

CDA6530: Performance Models of Computers and Networks. Chapter 2: Review of Practical Random Variables

Recitation 2: Probability

Final Exam # 3. Sta 230: Probability. December 16, 2012

Continuous Random Variables

Chapter 6 Expectation and Conditional Expectation. Lectures Definition 6.1. Two random variables defined on a probability space are said to be

ENGG2430A-Homework 2

Introduction to Machine Learning

Lecture 11. Probability Theory: an Overveiw

P (x). all other X j =x j. If X is a continuous random vector (see p.172), then the marginal distributions of X i are: f(x)dx 1 dx n

Econ 325: Introduction to Empirical Economics

STAT 302 Introduction to Probability Learning Outcomes. Textbook: A First Course in Probability by Sheldon Ross, 8 th ed.

f X, Y (x, y)dx (x), where f(x,y) is the joint pdf of X and Y. (x) dx

STA2603/205/1/2014 /2014. ry II. Tutorial letter 205/1/

Perhaps the simplest way of modeling two (discrete) random variables is by means of a joint PMF, defined as follows.

CDA6530: Performance Models of Computers and Networks. Chapter 2: Review of Practical Random

1 Presessional Probability

3. Probability and Statistics

Lecture 10: Probability distributions TUESDAY, FEBRUARY 19, 2019

Probability theory. References:

Practice Examination # 3

Introduction to Statistical Inference Self-study

ECE 302 Division 2 Exam 2 Solutions, 11/4/2009.

6.041/6.431 Fall 2010 Quiz 2 Solutions

Statistical Methods in Particle Physics

STAT 430/510: Lecture 16

Random Variables and Expectations

Multiple Random Variables

MAS223 Statistical Inference and Modelling Exercises

Review of probability

Random Variables. Random variables. A numerically valued map X of an outcome ω from a sample space Ω to the real line R

STAT Chapter 5 Continuous Distributions

Distributions of Functions of Random Variables. 5.1 Functions of One Random Variable

18.440: Lecture 28 Lectures Review

STA 256: Statistics and Probability I

Multivariate distributions

Probability. Paul Schrimpf. January 23, Definitions 2. 2 Properties 3

Probability Review. Chao Lan

Review (probability, linear algebra) CE-717 : Machine Learning Sharif University of Technology

p. 6-1 Continuous Random Variables p. 6-2

Lecture 1: August 28

EE4601 Communication Systems

Why study probability? Set theory. ECE 6010 Lecture 1 Introduction; Review of Random Variables

2 (Statistics) Random variables

Covariance and Correlation

Review of Statistics

(y 1, y 2 ) = 12 y3 1e y 1 y 2 /2, y 1 > 0, y 2 > 0 0, otherwise.

Random Variables. Cumulative Distribution Function (CDF) Amappingthattransformstheeventstotherealline.

Lecture 1: Basics of Probability

STAT 430/510: Lecture 15

Appendix A : Introduction to Probability and stochastic processes

Random Variables and Their Distributions

Introduction to Stochastic Processes

Review: mostly probability and some statistics

Statistics for Economists Lectures 6 & 7. Asrat Temesgen Stockholm University

We introduce methods that are useful in:

1 Review of Probability and Distributions

Stochastic Models of Manufacturing Systems

Table of z values and probabilities for the standard normal distribution. z is the first column plus the top row. Each cell shows P(X z).

CME 106: Review Probability theory

L2: Review of probability and statistics

Lecture 4. Continuous Random Variables and Transformations of Random Variables

Communication Theory II

Probability. Table of contents

Introduction to Probability and Stocastic Processes - Part I

Chapter 5. Chapter 5 sections

CDA5530: Performance Models of Computers and Networks. Chapter 2: Review of Practical Random Variables

Single Maths B: Introduction to Probability

Chapter Learning Objectives. Probability Distributions and Probability Density Functions. Continuous Random Variables

Problem Y is an exponential random variable with parameter λ = 0.2. Given the event A = {Y < 2},

This exam is closed book and closed notes. (You will have access to a copy of the Table of Common Distributions given in the back of the text.

Statistics for Data Analysis. Niklaus Berger. PSI Practical Course Physics Institute, University of Heidelberg

Basics on Probability. Jingrui He 09/11/2007

Expectation. DS GA 1002 Statistical and Mathematical Models. Carlos Fernandez-Granda

3 Multiple Discrete Random Variables

STAT 430/510 Probability Lecture 7: Random Variable and Expectation

Transcription:

Joint Probability Distributions, Correlations

What we learned so far Events: Working with events as sets: union, intersection, etc. Some events are simple: Head vs Tails, Cancer vs Healthy Some are more complex: 10<Gene expression<100 Some are evcen more complex: Series of dice rolls: 1,3,5,3,2 Conditional probability: P(A B)=P(A B)/P(B) Independent events: P(A B)=P(A) or P(A B)= P(A)*P(B) Bayes theorem: relates P(A B) to P(B A) Random variables: Mean, Variance, Standard deviation. How to work with E(g(X)) Discrete (Uniform, Bernoulli, Binomial, Poisson, Geometric, Negative binomial, Hypergeometric, Power law); PMF: f(x)=prob(x=x); CDF: F(x)=Prob(X x); Continuous (Uniform, Exponential, Erlang, Gamma, Normal, Lognormal); PDF: f(x) such that Prob(X inside A)= A f(x)dx; CDF: F(x)=Prob(X x) Next step: work with multiple random variables

Concept of Joint Probabilities Biological systems are usually described not by a single random variable but by many random variables Example: The expression state of a human cell: 20,000 random variables X i for each of its genes A joint probability distribution describes the behavior of several random variables We will start with just two random variables X and Y and generalize when necessary Chapter 5 Introduction 3

Joint Probability Mass Function Defined The joint probability mass function of the discrete random variables X and Y, denoted as f x, y, satifies: XY (1) f x, y 0 All probabilities are non-negative XY (2) f x, y 1 The sum of all x y XY probabilities is 1 (3) f x, y P X x, Y y (5-1) XY Sec 5 1.1 Joint Probability Distributions 4

Example 5 1: # Repeats vs. Signal Bars You use your cell phone to check your airline reservation. It asks you to speak the name of your departure city to the voice recognition system. Let Y denote the number of times you have to state your departure city. Let X denote the number of bars of signal strength on you cell phone. y = number of times city x = number of bars of signal strength name is stated 1 2 3 1 0.01 0.02 0.25 2 0.02 0.03 0.20 3 0.02 0.10 0.05 4 0.15 0.10 0.05 Figure 5 1 Joint probability distribution of X and Y. The table cells are the probabilities. Observe that more bars relate to less repeating. Probability 0.25 0.20 0.15 0.10 0.05 0.00 Bar Chart of Number of Repeats vs. Cell Phone Bars 1 2 Cell Phone Bars 3 4 Times 3 Times Twice Once Sec 5 1.1 Joint Probability Distributions 5

Marginal Probability Distributions (discrete) For a discrete joint PDF, there are marginal distributions for each random variable, formed by summing the joint PMF over the other variable. f x f x, y X y XY f y f x, y Y x XY Called marginal because they are written in the margins y = number of times city name x = number of bars of signal strength is stated 1 2 3 f Y ( y ) = 1 0.01 0.02 0.25 0.28 2 0.02 0.03 0.20 0.25 3 0.02 0.10 0.05 0.17 4 0.15 0.10 0.05 0.30 f X (x ) = 0.20 0.25 0.55 1.00 Figure 5 6 From the prior example, the joint PMF is shown in green while the two marginal PMFs are shown in purple. Sec 5 1.2 Marginal Probability Distributions 6

Mean & Variance of X and Y are calculated using marginal distributions y = number of times city x = number of bars of signal strength name is stated 1 2 3 f (y ) = y *f (y ) = y 2 *f (y ) = 1 0.01 0.02 0.25 0.28 0.28 0.28 2 0.02 0.03 0.20 0.25 0.50 1.00 3 0.02 0.10 0.05 0.17 0.51 1.53 4 0.15 0.10 0.05 0.30 1.20 4.80 f (x ) = 0.20 0.25 0.55 1.00 2.49 7.61 x *f (x ) = 0.20 0.50 1.65 2.35 x 2 *f (x ) = 0.20 1.00 4.95 6.15 μ X =E(X) = 2.35; σ X2 = V(X) = 6.15 2.35 2 = 6.15 5.52 = 0.6275 μ Y = E(Y) = 2.49; σ Y2 =V(Y) = 7.61 2.49 2 = 7.61 16.20 = 1.4099 Sec 5 1.2 Marginal Probability Distributions 7

Conditional Probability Distributions Recall that P B A P A B P A P(Y=y X=x)=P(X=x,Y=y)/P(X=x)= =f(x,y)/f X (x) From Example 5 1 P(Y=1 X=3) = 0.25/0.55 = 0.455 P(Y=2 X=3) = 0.20/0.55 = 0.364 P(Y=3 X=3) = 0.05/0.55 = 0.091 P(Y=4 X=3) = 0.05/0.55 = 0.091 Sum = 1.00 y = number of times city name is stated x = number of bars of signal strength 1 2 3 f Y (y ) = 1 0.01 0.02 0.25 0.28 2 0.02 0.03 0.20 0.25 3 0.02 0.10 0.05 0.17 4 0.15 0.10 0.05 0.30 f X (x ) = 0.20 0.25 0.55 1.00 Note that there are 12 probabilities conditional on X, and 12 more probabilities conditional upon Y. Sec 5 1.3 Conditional Probability Distributions 8

Joint Random Variable Independence Random variable independence means that knowledge of the values of X does not change any of the probabilities associated with the values of Y. Opposite: Dependence implies that the values of X are influenced by the values of Y Sec 5 1.4 Independence 9

Independence for Discrete Random Variables Remember independence of events (slide 21 lecture 3) : P(A B)=P(A B)/P(B)=P(A) or P(B A)= P(A B)/P(A)=P(B) or P(A B)=P(A) P(B) Random variables independent if any events A that Y=y and B that X=x are independent P(Y=y X=x)=P(Y=y) for any x or P(X=x Y=y)=P(X=x) for any y or P(X=x, Y=y)=P(X=x) P(Y=y) for any x and y

X and Y are Bernoulli variables Y=0 Y=1 X=0 2/6 1/6 X=1 2/6 1/6 What is the marginal P Y (Y=0)? A. 1/6 B. 2/6 C. 3/6 D. 4/6 E. I don t know Get your i clickers 12

X and Y are Bernoulli variables Y=0 Y=1 X=0 2/6 1/6 X=1 2/6 1/6 What is the marginal P Y (Y=0)? A. 1/6 B. 2/6 C. 3/6 D. 4/6 E. I don t know Get your i clickers 13

X and Y are Bernoulli variables Y=0 Y=1 X=0 2/6 1/6 X=1 2/6 1/6 What is the conditional P(X=0 Y=0)? A. 2/6 B. 1/2 C. 1/6 D. 4/6 E. I don t know Get your i clickers 14

X and Y are Bernoulli variables Y=0 Y=1 X=0 2/6 1/6 X=1 2/6 1/6 What is the conditional P(X=0 Y=0)? A. 2/6 B. 1/2 C. 1/6 D. 4/6 E. I don t know Get your i clickers 15

X and Y are Bernoulli variables Y=0 Y=1 X=0 2/6 1/6 X=1 2/6 1/6 Are they independent? A. yes B. no C. I don t know Get your i clickers 16

X and Y are Bernoulli variables Y=0 Y=1 X=0 2/6 1/6 X=1 2/6 1/6 Are they independent? A. yes B. no C. I don t know Get your i clickers 17

X and Y are Bernoulli variables Y=0 Y=1 X=0 1/2 0 X=1 0 1/2 Are they independent? A. yes B. no C. I don t know Get your i clickers 18

X and Y are Bernoulli variables Y=0 Y=1 X=0 1/2 0 X=1 0 1/2 Are they independent? A. yes B. no C. I don t know Get your i clickers 19

Joint Probability Density Function Defined The joint probability density function for the continuous random variables X and Y, denotes as f XY (x,y), satisfies the following properties: (1) f x, y 0 for all x, y XY (2) f x, y dxdy 1 XY XY (3) P X, Y R f x, y dxdy (5-2) R Figure 5 2 Joint probability density function for the random variables X and Y. Probability that (X, Y) is in the region R is determined by the volume of f XY (x,y) over the region R. Sec 5 1.1 Joint Probability Distributions 20

Joint Probability Density Function Figure 5 3 Joint probability density function for the continuous random variables X and Y of expression levels of two different genes. Note the asymmetric, narrow ridge shape of the PDF indicating that small values in the X dimension are more likely to occur when small values in the Y dimension occur. Sec 5 1.1 Joint Probability Distributions 21

Marginal Probability Distributions (continuous) Rather than summing a discrete joint PMF, we integrate a continuous joint PDF. The marginal PDFs are used to make probability statements about one variable. If the joint probability density function of random variables X and Y is f XY (x,y), the marginal probability density functions of X and Y are: f x f x, y dy X y XY f y f x, y dx (5-3) Y x XY X Y, f x f x y, Sec 5 1.2 Marginal Probability Distributions 22 y x XY f y f x y XY

Conditional Probability Density Function Defined Given continuous random variables X and Y with joint probability density function f x, y, the conditional probability densiy function of Y given fxy x, y fxy x, y f y = if fx x0 Yx f x f x, y dy y X y XY Compare to discrete: P(Y=y X=x)=f XY (x,y)/f X (x) Yx which satifies the following properties: (1) f 0 Yx (2) f y dy 1 Yx XY Sec 5 1.3 Conditional Probability Distributions X=x is (5-4) (3) PY BX x f ydyfor any set B in the range of Y B 23

Conditional Probability Distributions Conditional probability distributions can be developed for multiple random variables by extension of the ideas used for two random variables. Suppose p = 5 and we wish to find the distribution of X 1, X 2 and X 3 conditional on X 4 =x 4 and X 5 =x 5. f x, x, x XX X 1 2 3 4 5 4 5 1 2 3 for f x, x 0. X X xx 4 5 f x, x, x, x, x XX XX X 1 2 3 4 5 4 5 1 2 3 4 5 f x, x X X 4 5 Sec 5 1.5 More Than Two Random Variables 24

Independence for Continuous Random Variables For random variables X and Y, if any one of the following properties is true, the others are also true. Then X and Y are independent. Y X X Y X A Y B PX APY B (1) f x, y f x f y XY X Y (2) f y f y for all x and y with f x 0 Yx (3) f y f x for all x and y with f y 0 Xy P(Y=y X=x)=P(Y=y) for any x or P(X=x Y=y)=P(X=x) for any y or P(X=x, Y=y)=P(X=x) P(Y=y) for any x and y (4) P, for any sets A and B in the range of X and Y, respectively. (5-7) Sec 5 1.4 Independence 25

Covariation, Correlations

Covariance Defined Covariance is a number qunatifying between two random variables. average dependence The covariance between the random variables X and Y, denoted as cov XY, or is E X Y E XY XY 5-14) XY X Y X Y The units of are units of X times units of Y. XY Unlike the range of variance, -. XY ( Sec 5 2 Covariance & Correlation 29

Covariance and PMF tables y = number of times city name is stated x = number of bars of signal strength 1 2 3 1 0.01 0.02 0.25 2 0.02 0.03 0.20 3 0.02 0.10 0.05 4 0.15 0.10 0.05 The probability distribution of Example 5 1 is shown. By inspection, note that the larger probabilities occur as X and Y move in opposite directions. This indicates a negative covariance. Sec 5 2 Covariance & Correlation 30

Covariance and Scatter Patterns Figure 5 13 Joint probability distributions and the sign of cov(x, Y). Note that covariance is a measure of linear relationship. Variables with non zero covariance are correlated. Sec 5 2 Covariance & Correlation 31

Independence Implies σ=ρ = 0 but not vice versa If X and Y are independent random variables, σ XY = ρ XY = 0 (5 17) ρ XY = 0 is necessary, but not a sufficient condition for independence. Independent covariance=0 NOT independent covariance=0 Sec 5 2 Covariance & Correlation 32

Correlation is normalized covariance Also called: Pearson correlation coefficient ρ XY =σ XY /σ X σ Y is the covariance normalized to be 1 ρ XY 1 Karl Pearson (1852 1936) English mathematician and biostatistician

Spearman rank correlation Pearson correlation tests for linear relationship between X and Y Unlikely for variables with broad distributions nonlinear effects dominate Spearman correlation tests for any monotonic relationship between X and Y Calculate ranks (1 to n), r X (i) and r Y (i) of variables in both samples. Calculate Pearson correlation between ranks: Spearman(X,Y) = Pearson(r X, r Y ) Ties: convert to fractions, e.g. tie for 6s and 7s place both get 6.5. This can lead to artefacts. If lots of ties: use Kendall rank correlation (Kendall tau)

Matlab exercise: Correlation/Covariation Generate a sample with Stats=100,000 of two Gaussian random variables r1 and r2 which have mean 0 and standard deviation 2 and are: Uncorrelated Correlated with correlation coefficient 0.9 Correlated with correlation coefficient 0.5 Trick: first make uncorrelated r1 and r2. Then change r1 to: r1m=mix.*r2+(1 mix.^2)^0.5.*r1; where mix= corr. coeff. In each case calculate covariance and correlation coefficient In each case make scatter plot: plot(r1,r2, k. );

Matlab exercise: Correlation/Covariation 1. Stats=100000; 2. r1=2.*randn(stats,1); 3. r2=2.*randn(stats,1); 4. disp('covariance matrix='); disp(cov(r1,r2)); 5. disp('correlation=');disp(corr(r1,r2)); 6. figure; plot(r1,r2,'ko'); 7. mix=0.9; %Mixes r2 to r1 but keeps same variance 8. r1m=mix.*r2+sqrt(1 mix.^2).*r1; 9. disp('covariance matrix='); disp(cov(r1m,r2)); 10.disp('Correlation=');disp(corr(r1m,r2)); 11.figure; plot(r1m,r2,'ko'); 12.mix= 0.5; %REDO LINES 8 11

Linear Functions of Random Variables A function of random variables is itself a random variable. A function of random variables can be formed by either linear or nonlinear relationships. We start with linear functions. Given random variables X 1, X 2,,X p and constants c 1, c 2,, c p Y= c 1 X 1 + c 2 X 2 + + c p X p (5 24) is a linear combination of X 1, X 2,,X p. Sec 5 4 Linear Functions of Random Variables 40

Mean & Variance of a Linear Function Y= c 1 X 1 + c 2 X 2 + + c p X p 1 1 2 2 p p E Y c E X c E X... c E X (5-25) 2 2 2 Yc1V X1c2V X2 cpvx p cc i j XiX j V... 2 cov (5-26) If X, X,..., X are independent, then cov X X 0, 1 2 i j p i j 2 2 V Y c V X c V X... c V X 1 1 2 2 2 p p (5-27) Sec 5 4 Linear Functions of Random Variables 42

Example 5 31: Error Propagation A semiconductor product consists of three layers. The variances of the thickness of each layer is 25, 40 and 30 nm 2. What is the variance of the finished product? Answer: V X V X SD X X X X X 1 2 3 3 25 40 30 95 nm i1 95 9.7 nm i 2 Sec 5 4 Linear Functions of Random Variables 43

Mean & Variance of an Average X1 X2... X p If X and p E X i p Then EX (5-28a) p If the X are independent with V X i 2 2 p Then V X (5-28b) 2 p p i 2 Sec 5 4 Linear Functions of Random Variables 46

Credit: XKCD comics