R Based Probability Distributions

Similar documents
1 Probability Distributions

R Functions for Probability Distributions

ST 371 (V): Families of Discrete Distributions

Name: Firas Rassoul-Agha

Math 493 Final Exam December 01

Probability theory and inference statistics! Dr. Paola Grosso! SNE research group!! (preferred!)!!

Probability Distributions.

Matematisk statistik allmän kurs, MASA01:A, HT-15 Laborationer

Random Variable. Discrete Random Variable. Continuous Random Variable. Discrete Random Variable. Discrete Probability Distribution

Lecture 4: Random Variables and Distributions

The random variable 1

STT 315 Problem Set #3

Introduction to Statistical Data Analysis Lecture 3: Probability Distributions

The Central Limit Theorem

Topic 9 Examples of Mass Functions and Densities

Stochastic Processes. Review of Elementary Probability Lecture I. Hamid R. Rabiee Ali Jalali

Chapter 2: The Random Variable

Statistical distributions: Synopsis

Review of Elementary Probability Lecture I Hamid R. Rabiee

Chapter 3. Chapter 3 sections

Bernoulli Trials, Binomial and Cumulative Distributions

STAT 801: Mathematical Statistics. Hypothesis Testing

functions Poisson distribution Normal distribution Arbitrary functions

Probability Density Functions and the Normal Distribution. Quantitative Understanding in Biology, 1.2

Some Statistics. V. Lindberg. May 16, 2007

Stats + Homework 2 Review. CS100 TAs

2.3 Estimating PDFs and PDF Parameters

Example 1. Assume that X follows the normal distribution N(2, 2 2 ). Estimate the probabilities: (a) P (X 3); (b) P (X 1); (c) P (1 X 3).

Special Discrete RV s. Then X = the number of successes is a binomial RV. X ~ Bin(n,p).

Math 416 Lecture 3. The average or mean or expected value of x 1, x 2, x 3,..., x n is

Statistics for Managers Using Microsoft Excel (3 rd Edition)

MATH Notebook 5 Fall 2018/2019

Physics 5153 Classical Mechanics. Solution by Quadrature-1

Problem 1. Problem 2. Problem 3. Problem 4

ELEG 3143 Probability & Stochastic Process Ch. 4 Multiple Random Variables

Chapter 3 Single Random Variables and Probability Distributions (Part 1)

Physics 403 Probability Distributions II: More Properties of PDFs and PMFs

FW 544: Computer Lab Probability basics in R

1036: Probability & Statistics

MODULE 6 LECTURE NOTES 1 REVIEW OF PROBABILITY THEORY. Most water resources decision problems face the risk of uncertainty mainly because of the

SIO 211B, Rudnick. We start with a definition of the Fourier transform! ĝ f of a time series! ( )

3. Several Random Variables

Chapter 1. Sets and probability. 1.3 Probability space

Chapter 2. Random Variable. Define single random variables in terms of their PDF and CDF, and calculate moments such as the mean and variance.

Topic 3: The Expectation of a Random Variable

Data, Estimation and Inference

Things to remember when learning probability distributions:

Chapter 6 Continuous Probability Distributions

1 Relative degree and local normal forms

GOV 2001/ 1002/ E-2001 Section 3 Theories of Inference

Ex x xf xdx. Ex+ a = x+ a f x dx= xf x dx+ a f xdx= xˆ. E H x H x H x f x dx ˆ ( ) ( ) ( ) μ is actually the first moment of the random ( )

Outline PMF, CDF and PDF Mean, Variance and Percentiles Some Common Distributions. Week 5 Random Variables and Their Distributions

Signal Detection and Estimation

THE INTERNATIONAL UNIVERSITY (IU) Course: Probability Models in Operations Research Department of Industrial System Engineering

Chapter 2: Random Variables

MTH302 Quiz # 4. Solved By When a coin is tossed once, the probability of getting head is. Select correct option:

IE 230 Probability & Statistics in Engineering I. Closed book and notes. 120 minutes.

Bernoulli Trials and Binomial Distribution

Binomial and Poisson Probability Distributions

Probability, For the Enthusiastic Beginner (Exercises, Version 1, September 2016) David Morin,

Lecture 09: Sep 19, Randomness. Random Variables Sampling Probability Distributions Caching. James Balamuta STAT UIUC

Binomial random variable

EXAM. Exam #1. Math 3342 Summer II, July 21, 2000 ANSWERS

The Normal Distribution

Probability Distributions Columns (a) through (d)

Probabilities and distributions

IE 230 Probability & Statistics in Engineering I. Closed book and notes. 60 minutes.

Lecture 3. Biostatistics in Veterinary Science. Feb 2, Jung-Jin Lee Drexel University. Biostatistics in Veterinary Science Lecture 3

Lecture 2 Binomial and Poisson Probability Distributions

Part 3: Parametric Models

Chapter 5 Formulas Distribution Formula Characteristics Binomial Probability Mass. π is the probability Function

Chapter (4) Discrete Probability Distributions Examples

Introduction to Statistics and Error Analysis

Discrete & Continuous Probability Distributions Sunu Wibirama

1 Presessional Probability

Chapter 6 Reliability-based design and code developments

Special distributions

z and t tests for the mean of a normal distribution Confidence intervals for the mean Binomial tests

Math-3 Lesson 1-4. Review: Cube, Cube Root, and Exponential Functions

Chapter 8: An Introduction to Probability and Statistics

Exponential, Gamma and Normal Distribuions

CS 361: Probability & Statistics

Scientific Measurement

ENSC327 Communications Systems 2: Fourier Representations. School of Engineering Science Simon Fraser University

Dr. Junchao Xia Center of Biophysics and Computational Biology. Fall /13/ /12

PROBABILITY THEORY. Prof. S. J. Soni. Assistant Professor Computer Engg. Department SPCE, Visnagar

Chapter 5. Means and Variances

Least-Squares Spectral Analysis Theory Summary

ΔP(x) Δx. f "Discrete Variable x" (x) dp(x) dx. (x) f "Continuous Variable x" Module 3 Statistics. I. Basic Statistics. A. Statistics and Physics

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

Guidelines for Solving Probability Problems

Statistical Methods in Particle Physics

Expected Value - Revisited

Statistical Methods in Particle Physics

MA 250 Probability and Statistics. Nazar Khan PUCIT Lecture 15

Lecture 3. Discrete Random Variables

Random Variables Example:

Probability Rules. MATH 130, Elements of Statistics I. J. Robert Buchanan. Fall Department of Mathematics

n N CHAPTER 1 Atoms Thermodynamics Molecules Statistical Thermodynamics (S.T.)

EE/CpE 345. Modeling and Simulation. Fall Class 9

Transcription:

General Comments R Based Probability Distributions When a parameter name is ollowed by an equal sign, the value given is the deault. Consider a random variable that has the range, a x b. The parameter, lower.tail, when TRUE means that the cumulative distribution unction is to be interpreted as running rom a to some speciied value o x = x'. When the parameter is FALSE the cumulative distribution unction is to be interpreted as running rom x' to b. Probability density unctions all start with the letter d. Example, dbinom(). Cumulative distribution unctions all start with the letter p. Example, pnorm(). Inverse cumulative distribution unctions all start with the letter q (which is short or quantile). Example, qt(). Random number generators all start with the letter r. Example, runi(). Full examples o unction names are given under Binomial. Available Distributions Enter?Distributions to get a complete listing. Common distributions in chemical data processing are: binomial: binom(), occurs when an experiment has two outcomes, e.g. success or ailure. It deals with the distribution o successes out o a speciied number o trials. The random variable is discrete. An example is solvent extraction. Cauchy (Lorentzian): cauchy(), occurs when observing spectroscopic line shapes, or the Fourier transorm o a ree induction decay. exponential: exp(), results rom a irst order process. F statistic: (), occurs when comparing two experimental variances. normal (Gaussian): norm(), the bell shaped curve that represents the distribution o thermal noise. Poisson: pois(), the distribution o counting data. The random variable is discrete. t statistic: t(), occurs when comparing data normalized by the experimental standard deviation. uniorm: uni(), occurs when a random variable has a constant probability over its entire range, e.g. rolling a die. The random variable can be discrete or continuous.

Binomial This discrete density unction is given by, n! x x, n, p p p x! n x! where x is the number o successes, n is the number o trials (called size in R), and p is the probability o observing a success. The range o the random variable is 0 x n. In R the actorial term is given by the strangely named unction, choose(n,x). The mean is given by np and the variance by np( p). In the ollowing unction calls, the notation... signiies that there are less commonly used parameters. dbinom(x,size,probability,...), x is the number o successes, size is the number o trials, and probability is the probability o observing a success. As an example, dbinom(5,0,0.5) is the probability o observing 5 heads when tossing a coin 0 times. pbinom(q,size,probability), the probability o observing 0 to q successes out o size tries, where probability is the probability o observing a success. As an example, pbinom(5,0,0.5) is the probability o observing 0 through 5 heads when tossing a coin ten times. qbinom(p,size,probability), the value o q required so that observing 0 to q successes has a probability o p. Again, size is the number o tries and probability is the probability o observing a success. As an example, q <- qbinom(0.5,0,0.5) yields q = 5 where the range 0 to 5 successes is observed with a 0.5 probability, when tossing a coin 0 times. rbinom(n,size,probability), generates n random successes ranging rom 0 to size in value, when probability is the probability o a success. As an example, rbinom(8,0,0.5) yields, (6, 8, 5, 4, 4, 5, 5, 6) which is the number o heads observed or each o 8 replications o an experiment where a coin is tossed ten times. Cauchy This continuous density unction is given by, nx x,, x where x is the random variable, µ is the mean, Γ is the ull width at hal maximum (FWMH or peak width). The mean is µ. The distribution does not have a inite variance. dcauchy(x, location=0,scale=,...), x is the random variable, location is µ in the above equation, and scale is Γ/.

Exponential This continuous density unction has two common orms,, exp, exp x x t t where x or t are the random variable, /λ (or τ) is the mean and /λ (or τ ) is the variance. Chemists usually call λ the rate constant and τ the lietime, where λ = /τ. Note: 0 x,t. F Statistic dexp(x,rate=,...), x is the random variable and rate is λ. This continuous density has the orm, x,, x x where x is the random variable, φ is the numerator degrees o reedom, and φ is the denominator degrees o reedom. Γ () is the gamma unction (in R, gamma()). The mean and variance are o little importance. Note: since variances are positive, 0 x. d(x,d,d,...), x is the random variable, d is the numerator degrees o reedom, and d is the denominator degrees o reedom. Normal (Gaussian) This continuous density has the orm, x,, exp x where x is the continuous random variable, µ is the mean, and σ is the variance. dnorm(x,mean=0,sd=,...), x is the random variable, mean is the mean, and sd is the standard deviation. 3

Poisson This discrete Poisson or counting density has the orm, x x! x, exp where x is the random variable, µ is the mean and variance. Note: 0 x. t Statistic dpois(x,lambda,...), x is the random variable and lambda is the mean. This continuous density has the orm, x x, where x is the random variable and φ is the degrees o reedom. The mean and variance are o little importance. Γ is the gamma unction (not the gamma density!). Uniorm dt(x,d,...), x is the random variable and d is the degrees o reedom. The discrete and uniorm density unctions both have the orm, x, a, b b a where x is the random variable over the range, a < x b. For a discrete variable it is important that the lower bound, a, is not included. This distinction makes no dierence with a continuous random variable since < and are only o by the ininitely small amount, dx. The means are (b + a + )/ or discrete and (b + a)/ or continuous distributions. The variances are [(b a) ]/ or discrete and (b a) / or continuous. duni(x,min=0,max=,...), where x is the continuous random variable, min is a, and max is b. 4

Visualizing the Density Functions For continuous density unctions a quick and dirty way to visualize them is to use the curve() unction. For example, curve(dnorm,-4,4,lwd=3) grid(col='black') dnorm (x) 0.0 0. 0. 0.3 0.4-4 - 0 4 x 5

For discrete density unctions use the barplot() unction. For example, x <- 0:0 p <- dpois(x,5) barplot(p,names.arg=as.character(x)) abline(h=c(0.05,0.0,0.5),lty=3,col='black') 0.00 0.05 0.0 0.5 0 3 4 5 6 7 8 9 3 5 7 9 6