Download presentation

Presentation is loading. Please wait.

Published bySavannah Harding Modified over 2 years ago

1
STATISTICS Random Variables and Probability Distributions Professor Ke-Sheng Cheng Department of Bioenvironmental Systems Engineering National Taiwan University

2
Definition of random variable (RV) For a given probability space (, A, P[ ]), a random variable, denoted by X or X( ), is a function with domain and counterdomain the real line. The function X( ) must be such that the set A r, denoted by, belongs to A for every real number r. Unlike the probability which is defined on the event space, a random variable is defined on the sample space. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

3
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. Random experiment Sample space Event space Probability space is defined whereas is not defined.

4
Cumulative distribution function (CDF) The cumulative distribution function of a random variable X, denoted by, is defined to be 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

5
Consider the experiment of tossing two fair coins. Let random variable X denote the number of heads. CDF of X is 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

6
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

7
Indicator function or indicator variable Let be any space with points and A any subset of. The indicator function of A, denoted by, is the function with domain and counterdomain equal to the set consisting of the two real numbers 0 and 1 defined by 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

8
Discrete random variables A random variable X will be defined to be discrete if the range of X is countable. If X is a discrete random variable with values then the function denoted by and defined by is defined to be the discrete density function of X. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

9
Continuous random variables A random variable X will be defined to be continuous if there exists a function such that for every real number x. The function is called the probability density function of X. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

10
Properties of a CDF is continuous from the right, i.e. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

11
Properties of a PDF 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

12
Example 1 Determine which of the following are valid distribution functions: 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

13
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

14
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

15
Example 2 Determine the real constant a, for arbitrary real constants m and 0 < b, such that is a valid density function. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

16
Function is symmetric about m. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

17
Characterizing random variables Cumulative distribution function Probability density function – Expectation (expected value) – Variance – Moments – Quantile – Median – Mode 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

18
Expectation of a random variable The expectation (or mean, expected value) of X, denoted by or E(X), is defined by: 1/31/2014 Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 18

19
Rules for expectation Let X and X i be random variables and c be any real constant. 1/31/2014 Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 19

20
1/31/2014 Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 20

21
Variance of a random variable 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

22
is called the standard deviation of X. Variance characterizes the dispersion of data with respect to the mean. Thus, shifting a density function does not change its variance. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

23
Rules for variance 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

24
Two random variables are said to be independent if knowledge of the value assumed by one gives no clue to the value assumed by the other. Events A and B are defined to be independent if and only if 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

25
Moments and central moments of a random variable 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

26
Properties of moments 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

27
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

28
Quantile The q th quantile of a random variable X, denoted by, is defined as the smallest number satisfying. 1/31/2014 Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 28 Discrete Uniform

29
Median and mode The median of a random variable is the 0.5 th quantile, or. The mode of a random variable X is defined as the value u at which is the maximum of. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

30
Note: For a positively skewed distribution, the mean will always be the highest estimate of central tendency and the mode will always be the lowest estimate of central tendency (assuming that the distribution has only one mode). For negatively skewed distributions, the mean will always be the lowest estimate of central tendency and the mode will be the highest estimate of central tendency. In any skewed distribution (i.e., positive or negative) the median will always fall in-between the mean and the mode. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

31
Moment generating function 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

32
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

33
Usage of MGF MGF can be used to express moments in terms of PDF parameters and such expressions can again be used to express mean, variance, coefficient of skewness, etc. in terms of PDF parameters. Random variables of the same MGF are associated with the same type of probability distribution. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

34
The moment generating function of a sum of independent random variables is the product of the moment generating functions of individual random variables. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

35
Expected value of a function of a random variable 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

36
If Y=g(X) 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

37
Y Y=g(X) X x 1 y x 2 x 3 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

38
Theorem 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

39
Chebyshev Inequality 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

40
The Chebyshev inequality gives a bound, which does not depend on the distribution of X, for the probability of particular events described in terms of a random variable and its mean and variance. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

41
Probability density functions of discrete random variables Discrete uniform distribution Bernoulli distribution Binomial distribution Negative binomial distribution Geometric distribution Hypergeometric distribution Poisson distribution 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

42
Discrete uniform distribution N ranges over the possible integers. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

43
Bernoulli distribution 1-p is often denoted by q. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

44
Binomial distribution Binomial distribution represents the probability of having exactly x success in n independent and identical Bernoulli trials. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

45
Negative binomial distribution Negative binomial distribution represents the probability of achieving the r-th success in x independent and identical Bernoulli trials. Unlike the binomial distribution for which the number of trials is fixed, the number of successes is fixed and the number of trials varies from experiment to experiment. The negative binomial random variable represents the number of trials needed to achieve the r- th success. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

46
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

47
Geometric distribution Geometric distribution represents the probability of obtaining the first success in x independent and identical Bernoulli trials. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

48
Hypergeometric distribution where M is a positive integer, K is a nonnegative integer that is at most M, and n is a positive integer that is at most M. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

49
Let X denote the number of defective products in a sample of size n when sampling without replacement from a box containing M products, K of which are defective. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

50
Poisson distribution The Poisson distribution provides a realistic model for many random phenomena for which the number of occurrences within a given scope (time, length, area, volume) is of interest. For example, the number of fatal traffic accidents per day in Taipei, the number of meteorites that collide with a satellite during a single orbit, the number of defects per unit of some material, the number of flaws per unit length of some wire, etc. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

51
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

52
Assume that we are observing the occurrence of certain happening in time, space, region or length. Also assume that there exists a positive quantity which satisfies the following properties: 1. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

53
/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

54
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. The probability of success (occurrence) in each trial.

55
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

56
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

57
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

58
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

59
Comparison of Poisson and Binomial distributions 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

60
Example Suppose that the average number of telephone calls arriving at the switchboard of a company is 30 calls per hour. (1) What is the probability that no calls will arrive in a 3-minute period? (2) What is the probability that more than five calls will arrive in a 5-minute interval? Assume that the number of calls arriving during any time period has a Poisson distribution. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

61
Assuming time is measured in minutes 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. Poisson distribution is NOT an appropriate choice.

62
Assuming time is measured in seconds 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. Poisson distribution is an appropriate choice.

63
The first property provides the basis for transferring the mean rate of occurrence between different observation scales. The small time interval of length h can be measured in different observation scales. represents the time length measured in scale of. is the mean rate of occurrence when observation scale is used. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

64
If the first property holds for various observation scales, say, then it implies the probability of exactly one happening in a small time interval h can be approximated by The probability of more than one happenings in time interval h is negligible. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

65
probability that more than five calls will arrive in a 5-minute interval Occurrences of events which can be characterized by the Poisson distribution is known as the Poisson process. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

66
Probability density functions of continuous random variables Uniform or rectangular distribution Normal distribution (also known as the Gaussian distribution) Exponential distribution (or negative exponential distribution) Gamma distribution (Pearson Type III) Chi-squared distribution Lognormal distribution 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

67
Uniform or rectangular distribution 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

68
PDF of U(a,b) 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

69
Normal distribution (Gaussian distribution) 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

70
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. Z

71
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

72
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

73
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. Z~N(0,1) X~N( μ 1, σ 1 ) Y~N( μ 2, σ 2 )

74
Commonly used values of normal distributions 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

75
Exponential distribution (negative exponential distribution) Mean rate of occurrence in a Poisson process. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

76
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

77
Gamma distribution represents the mean rate of occurrence in a Poisson process. is equivalent to in the exponential density. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

78
The exponential distribution is a special case of gamma distribution with The sum of n independent identically distributed exponential random variables with parameter has a gamma distribution with parameters. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

79
Pearson Type III distribution (PT3), and are the mean, standard deviation and skewness coefficient of X, respectively. It reduces to Gamma distribution if = 0. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

80
The Pearson type III distribution is widely applied in stochastic hydrology. Total rainfall depths of storm events can be characterized by the Pearson type III distribution. Annual maximum rainfall depths are also often characterized by the Pearson type III or log- Pearson type III distribution. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

81
Chi-squared distribution The chi-squared distribution is a special case of the gamma distribution with 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

82
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

83
Log-Normal Distribution Log-Pearson Type III Distribution (LPT3) A random variable X is said to have a log- normal distribution if Log(X) is distributed with a normal density. A random variable X is said to have a Log- Pearson type III distribution if Log(X) has a Pearson type III distribution. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

84
Lognormal distribution 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

85
Approximations between random variables Approximation of binomial distribution by Poisson distribution Approximation of binomial distribution by normal distribution Approximation of Poisson distribution by normal distribution 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

86
Approximation of binomial distribution by Poisson distribution 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

87
Approximation of binomial distribution by normal distribution Let X have a binomial distribution with parameters n and p. If, then for fixed a**
**

88
Approximation of Poisson distribution by normal distribution Let X have a Poisson distribution with parameter. If, then for fixed a**
**

89
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

90
Example Suppose that two fair dice are tossed 600 times. Let X denote the number of times that a total of 7 dots occurs. What is the probability that ? 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

91
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

92
Transformation of random variables [Theorem] Let X be a continuous RV with density f x. Let Y=g(X), where g is strictly monotonic and differentiable. The density for Y, denoted by f Y, is given by 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

93
Proof: Assume that Y=g(X) is a strictly monotonic increasing function of X. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

94
Example Let X be a gamma random variable with 1/31/2014 Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 94 Y is also a gamma random variable with scale parameter and shape parameter.

95
Definition of the location parameter 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

96
Example of location parameter 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

97
Definition of the scale parameter 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

98
Example of scale parameter 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

99
Simulation Given a random variable X with CDF F X (x), there are situations that we want to obtain a set of n random numbers (i.e., a random sample of size n) from F X (.). The advances in computer technology have made it possible to generate such random numbers using computers. The work of this nature is termedsimulation, or more precisely stochastic simulation. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

100
1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

101
Pseudo-random number generation Pseudorandom number generation (PRNG) is the technique of generating a sequence of numbers that appears to be a random sample of random variables uniformly distributed over (0,1). 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

102
A commonly applied approach of PRNG starts with an initial seed and the following recursive algorithm (Ross, 2002) modulo m where a and m are given positive integers, and the above equation means that is divided by m and the remainder is taken as the value of. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

103
The quantity is then taken as an approximation to the value of a uniform (0,1) random variable. Such algorithm will deterministically generate a sequence of values and repeat itself again and again. Consequently, the constants a and m should be chosen to satisfy the following criteria: – For any initial seed, the resultant sequence has the appearance of being a sequence of independent uniform (0,1) random variables. – For any initial seed, the number of random variables that can be generated before repetition begins is large. – The values can be computed efficiently on a digital computer. 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

104
A guideline for selection of a and m is that m be chosen to be a large prime number that can be fitted to the computer word size. For a 32-bit word computer, m = and a = result in desired properties (Ross, 2002). 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

105
Simulating a continuous random variable probability integral transformation 1/31/ Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ.

106
1/31/2014 Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 106 The cumulative distribution function of a continuous random variable is a monotonic increasing function.

107
Example 1/31/2014 Lab for Remote Sensing Hydrology and Spatial Modeling Dept of Bioenvironmental Systems Engineering, NTU 107 Generate a random sample of random variable V which has a uniform density over (0, 1). Convert to using the above V-to-X transformation.

108
Random number generation in R R commands for stochastic simulation (for normal distribution – pnorm – cumulative probability – qnorm – quantile function – rnorm – generating a random sample of a specific sample size – dnorm – probability density function For other distributions, simply change the distribution names. For examples, (punif, qunif, runif, and dunif) for uniform distribution and (ppois, qpois, rpois, and dpois) for Poisson distribution. 1/31/ Lab for Remote Sensing Hydrology and Spatial Modeling Dept of Bioenvironmental Systems Engineering, NTU

109
Generating random numbers of discrete distribution in R Discrete uniform distribution – R does not provide default functions for random number generation for the discrete uniform distribution. – However, the following functions can be used for discrete uniform distribution between 1 and k. rdu<-function(n,k) sample(1:k,n,replace=T) # random number ddu =1 & x<=k & round(x)==x,1/k,0) # density pdu<-function(x,k) ifelse(x<1,0,ifelse(x<=k,floor(x)/k,1)) # CDF qdu 1, return("undefined"), ceiling(p*k)) # quantile 1/31/2014 Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 109

110
– Similar, yet more flexible, functions are defined as follows dunifdisc =min & x<=max & round(x)==x, 1/(max-min+1), 0) >dunifdisc(23,21,40) >dunifdisc(c(0,1)) punifdisc max, 1, floor(q-min+1)/(max-min+1))) >punifdisc(0.2) >punifdisc(5,2,19) qunifdisc<-function(p, min=0, max=1) floor(p*(max-min+1))+min >qunifdisc( ,2,19) >qunifdisc(0.2) runifdisc<-function(n, min=0, max=1) sample(min:max, n, replace=T) >runifdisc(30,2,19) >runifdisc(30) 1/31/2014 Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 110

111
Binomial distribution 1/31/2014 Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 111

112
Negative binomial distribution 1/31/2014 Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 112

113
Geometric distribution 1/31/2014 Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 113

114
Hypergeometric distribution 1/31/2014 Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 114

115
Poisson distribution 1/31/2014 Laboratory for Remote Sensing Hydrology and Spatial Modeling, Dept of Bioenvironmental Systems Engineering, National Taiwan Univ. 115

116
An example of stochastic simulation The travel time from your home (or dormitory) to NTU campus may involve a few factors: – Walking to bus stop (stop for traffic lights, crowdedness on the streets, etc.) – Transportation by bus – Stop by 7-11 or Starbucks for breakfast (long queue) – Walking to campus 1/31/ Lab for Remote Sensing Hydrology and Spatial Modeling Dept of Bioenvironmental Systems Engineering, NTU

117
If you leave home at 8:00 a.m. for a class session of 9:10, what is the probability of being late for the class? Gamma distribution with mean 30 minutes and standard deviation 10 minutes. Exponential distribution with a mean of 20 minutes. All X i s are independently distributed. 1/31/ Lab for Remote Sensing Hydrology and Spatial Modeling Dept of Bioenvironmental Systems Engineering, NTU

Similar presentations

© 2016 SlidePlayer.com Inc.

All rights reserved.

Ads by Google