Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 1. Observations and random experiments Observations are viewed as outcomes of a random experiment.

Similar presentations


Presentation on theme: "1 1. Observations and random experiments Observations are viewed as outcomes of a random experiment."— Presentation transcript:

1 1 1. Observations and random experiments Observations are viewed as outcomes of a random experiment.

2 2 Observations Observation  random experiment (controlled) Outcome cannot be predicted with certainty Range of possible outcomes known With each outcome of an observation may be associated a unique numeric value The outcome variable, X, is a random variable because, until the experiment is performed, it is uncertain what value X will take. To quantify this uncertainty, probabilities are associated with values (x) of the R.V. X (and outcomes of experiment)

3 3 2.1 Continuous random variables

4 4 Continuous random variables Normal r.v.  probit model Logistic r.v.  logit model Uniform r.v.  waiting time to event Exponential r.v.  waiting time to event Gompertz r.v.

5 5 Gaussian probability model T ime at event follows a normal distribution with mean  and variance  2 (random variable is normally distributed)

6 6 Normal distribution: density With  the mean and  2 the variance Linear predictor:

7 7 Link function The link function relates the linear predictor  to the expected value  of the datum y (McCullagh and Nelder, 1989, p. 31)  = 

8 8 Standard normal density The probit model relies on a standard normal distribution (cumulative): it is the INVERSE of the standard normal With  = 0 the mean and  2 = 1 the variance

9 9 where Cumulative normal distribution Approximation by Page (1977) Azzalini, 1996, p. 269 Page, E. (1977) Approximations to the cumulative normal function and its inverse for use on a pocket calculator. Applied Statistics, 26:75-76

10 10 Returns the normal cumulative distribution for the specified mean and standard deviation. Syntax: NORMDIST(x,mean,standard_dev,cumulative) X is the value for which you want the distribution. Mean is the arithmetic mean of the distribution. Standard_dev is the standard deviation of the distribution. Cumulative is a logical value that determines the form of the function. If cumulative is TRUE, NORMDIST returns the cumulative distribution function; if FALSE, it returns the probability mass function. Example: NORMDIST(42,40,1.5,TRUE) equals 0.90879 NORMDIST(42,40,1.5,FALSE) equals 0.10934 Excel: NORMDIST

11 11 SPSS COMPUTE variable = RV.NORMAL (mean, standard deviation) COMPUTE test = RV.NORMAL(24,2). RV.NORMAL CDF.NORMAL Returns the cumulative probability that the a value of a normal distribution with given mean and standard deviation, will be less than a given quantity Q. COMPUTE variable = CDF.NORMAL(Q,mean,standard deviation) COMPUTE test2 = CDF.NORMAL(24,24,2). Test2 = 0.50

12 12 Inverse of standard normal cumulative distribution The probit is the value z p from the normal distribution for which the cumulative distribution is equal to a given probability p.

13 13 Excel: NORMSINV Inverse of standard normal cumulative distribution NORMSINV: Probability is a probability corresponding to the normal distribution. NORMSINV uses an iterative technique for calculating the function. Given a probability value, NORMSINV iterates until the result is accurate to within ± 3x10^-7. If NORMSINV does not converge after 100 iterations, the function returns the #N/A error value. Example: NORMSINV(0.908789) equals 1.3333 E.g.  (z) = 0.025 for z = -1.96 Probit(0.025) = -1.96  (z) = 0.975 for z = 1.96 Probit(0.975) = 1.96

14 14 SPSS: IDF.NORMAL Returns the value from the normal distribution for which the cumulative distribution is the given probability P. COMPUTE variable = IDF.NORMAL(P,mean,stddev) COMPUTE test3 = IDF.NORMAL(0.025,24,2). Test3 = 20.08 IDF.NORMAL (0.5,24,2) = 24

15 15 Example 1. Age at migration A sample of 20 males and 20 females Sample generated on computer: random number generator

16 16 Random sample of 20 males and 20 females: Age at migration Example 1 E:\f\life\rnumber\normal\mig\2.xls

17 17 Frequency table and diagram (SPSS)

18 18 SPSS linear regression: y = a + b x (y = age, x = sex)  1 = 24.3 for males  2 = 24.3 - 3.1 = 21.2 for females Cte:Lower bound: 24.3 - 1.96 * 0.535 = 23.2 Upper bound: 24.3 + 1.96 * 0.535 = 25.4  :Lower bound: -3.1 - 1.96 * 0.757 = -4.6 Upper bound: -3.1 + 1.96 * 0.756 = -1.6 Example 1

19 19 Random number generation Age at migration 200 respondents Normal random number in SPSS COMPUTE variable = RND(RV.NORMAL(24,2)). Logistic random number in SPSS COMPUTE variable = RND(RV.LOGISTIC(24,2)). Create frequency table in SPSS

20 20 Random number generation (SPSS) Age at migration 200 and 2000 respondents COMPUTE NORMAL1 = RND(RV.NORMAL(24,2)). VARIABLE LABELS normal1 "NORMAL N(24,4)". VARIABLE WIDTH normal1 (6). COMPUTE LOGIST = RND(RV.LOGISTIC(24,2)). VARIABLE LABLES logist "LOGISTIC L(24,1)". VARIABLE WIDTH logist(6). COMPUTE ONE = 1. /* Table of Frequencies. TABLES /FTOTAL $t 'Total' /* INCLUDE TOTAL /FORMAT BLANK MISSING('.') /TABLES (LABELS) + $t BY one > ( normal1 + logist ) /STATISTICS COUNT ((F5.0) 'Count' ).

21 21 N(mean, variance) = N(24,4) L(mean, scale parameter) = L(24,1) Age at migration 200 respondents

22 22 Age at migration 2000 respondents N(mean, variance) = N(24,4) L(mean, scale parameter) = L(24,1) Theoretical logistic: lambda = 1/1.81

23 23 Example 2

24 24 Example 2

25 25 SPSS Example 2

26 26 Example 3 Heaping!

27 27 2. The logistic model Duration = logistic r.v. Time at event = logistic r.v.

28 28 Standard logistic distribution With  (logit) the linear predictor ‘Standard’ logistic distribution with mean 0 and variance  2 =  2 /3  3.29 hence  = 1.81 Cumulative distribution: Probability density function: The logit model relies on a standard logistic distribution (variance  1 !) Probability of being in category 1 instead of categ. 0:

29 29 ‘Standardised’ logistic distribution  =  /  3  1.8138  = 1.8138 Standardized logistic with mean 0 and variance 1 Probability density function: Cumulative distribution:

30 30  = 1.81

31 31

32 32 Link function The link function relates the linear predictor  to the expected value p (  ) of the datum y (McCullagh and Nelder, 1989, p. 31) Logit:  = logit(p) = ln [p/(1-p)]

33 33 Logit Probit E.g.  (z) = 0.025 for z = -1.96 Probit(0.025) = -1.96 Link functions Translate probability scale (0,1) into real number scale (- ,+  ) E.g. logit(0.25) = -1.0986 logit(0.1235) = -1.96 logit(0.8765) = 1.96

34 34 Link functions

35 35 Demography: Uniform and exponential distributions of events [in an (age) interval] Probability density Intensity

36 36 3. The uniform distribution The linear model Duration = uniform r.v. Time at event = uniform r.v. Density

37 37 Uniform distribution Time at event follows uniform distribution (events are uniformly distributed during episode), implying a constant probability density for A  t  B Or: f(t) = 1/h for 0  t  h and h = B - A

38 38 Uniform distribution Survival function is linear

39 39 Uniform distribution: expectancies Since d = 1/h when S(h) = 0

40 40 Uniform distribution: expectancies When S(  ) =0

41 41 Uniform distribution: exposure The exposure function associated with the linear survival function is quadratic. a 2 +b 2 = (a+b) (a-b)

42 42 Uniform distribution: exposure Relation between exposure function and survival function: where 0 F(x,y) is the probability of an event in interval (x,y)

43 43 Uniform distribution: exposure Exposure during interval of length h, provided survival at beginning of interval: Exposure (waiting time to event) in interval (0,h): L(h) = h -  f h 2 = h S(h) +  f h 2 = h [1-  f h] Alternative specification: L(h) = h S(h) + E[X | 0  X  h] [1 - S(h)]

44 44 Uniform distribution: rate Since f = 1/  : and If length of interval is one, rate is 2!!

45 45 Uniform distribution Relation between rate and probability Since x F(x,y) =1 - S(y)/S(x) :

46 46 Uniform distribution Numerical illustration Let density f = 0.10Survival function: S(h) = 1 - f h => 1 - 0.10 h

47 47 1833=2026-0.5*386 0.0262= 48/1833 0.9738=1-0.0262

48 48 d=0.00218  =0.0022113=-ln(0.9738)/12

49 49 4. The exponential distribution Duration = exponential r.v. Time at event = exponential r.v. ln(duration) = uniform r.v. Intensity

50 50 Exponential distribution Time at event is exponentially distributed random variable, implying a constant intensity (  )

51 51 Exponential distribution Probability density function Distribution function Number of events during interval: Poisson distribution Intensity: Expected value Variance

52 52

53 53 2.2 Discrete random variables

54 54 Nominal variable: categories cannot be ordered Binomial: two possible values (categories, states) Multinomial: more than two possible values (categories, states) – multistate = multinomial

55 55 Bernoulli random variable Binary outcome: two possible outcomes Random experiment: Bernoulli trial (e.g. toss a coin: head/tail) Attribute present/absent Event did occur/did not occur during interval Success/failure

56 56 Bernoulli random variable Binary random variable: coding 0 and 1: reference category gets 0 (dummy coding; contrast coding) – Model parameters are deviations from reference category. -1 and +1 (effect coding: mean is reference category) – Model parameters are deviations from the mean. 1 and 2, etc. INTERPRETATION Vermunt, 1997, p. 10

57 57 Bernoulli random variable Parameter of Bernoulli distribution: expected value of ‘success’: p Variance: p(1-p) = pq Bernoulli process: sequence of independent Bernoulli observations (trials) in homogeneous population [identical B. trials] (e.g 30 observations) 10 1 1 0 0 0 1 1 1 1 0 1 0 1 0 1 1 0 1 0 1 1 0 0 1 1 1 0 1

58 58

59 59 Binomial distribution COUNT of ‘successes’ in m Bernoulli observations: N m (Binomial random variable) Probability mass function : Binomial distribution with parameter p and index m Number of observations is fixed (m)

60 60 Binomial distribution Expected number of ‘successes’: E[N m ]=mp Variance of N m : Var [N m ]=mp(1-p) – Binomial variance is smaller than the mean For one of m observations : Expected value: p Variance: Var[N m /m] = Var[N m ]/m 2 = [p(1-p)]/m –Variance decreases with number of observations

61 61

62 62 Application: the life table If there are l 0 individuals who are subject to the same force of mortality, the number l x of survivors at age x is a binomial random variable with probability p 0x of surviving to x. The probability distribution of l x is therefore (Chiang, 1984, p. 196): k = 0, 1, …, l 0

63 63 Application: the life table Expected value of l x : Variance of number of survivors l x : Variance of probability of surviving (survival function):

64 64 Application: the life table If there are l x individuals at age x, the number l y of survivors at age y is a binomial random variable with probability p xy of surviving to y. The probability distribution of l y|x is therefore (Chiang, 1984, p. 197): k y = 0, 1, …, l x

65 65 Application: the life table Expected value of l y : Variance of number of survivors l y : Variance of probability of surviving (survival function):

66 66 Application: the life table

67 67 Application: the life table

68 68 Application: IMR, Kerala IMR = 0.0262 = 1-p p = 0.9738 l 0 = 2026 (births) Expected value of l x : Variance of number of survivors l x : Variance of probability of surviving (survival function):

69 69 Multinomial random variable Polytomous random variable: more than two possible outcomes Random experiment: e.g. toss a die (6 possible outcomes) Attribute (e.g marital status, region of residence) Sequence of independent observations (trials) in homogeneous population [identical trials] (e.g 30 observations, each observation has 3 possible outcomes) 1 2 1 3 2 3 1 3 1 2 2 2 3 1 1 3 2 3 3 1 2 1 1 2 2 3 1 1 2 2 (11 times obs. 1; 11 times obs. 2; 8 times obs. 3)

70 70 Multinomial distribution Two categories (binomial): Binomial distribution with parameters  1 and  2 and index m with m = n 1 +n 2

71 71 Multinomial distribution Several categories: I possible outcomes With I the number of categories, m the number of observations, n i the number of observations in category/state i and  i the probability of an observation being in category I (parameter) [state probability].

72 72 Multinomial distribution Expected number in category i: E[N i ]=m  i Variance of N i : Var [N i ]= m  i (1-  i ) – Multinomial variance is smaller than the mean Covariance: Cov[N i N k ] = -m  i  k For one of m observations : Expected value:  i Variance: Var[N i /m] = Var[N i ]/m 2 = [  i (1-  i )]/m –Variance decreases with number of observations

73 73 Poisson distribution Number of events or occurrences of type i during given period (number of observations not fixed) Probability mass function: With n i given number of observations of type i during unit interval, i the expected number of observations during unit interval (parameter).  = ln is linear predictor

74 74

75 75 Poisson distribution Expected number of events: E[N i ] = i Variance of N i : Var[N i ] = i – Equality of mean and variance is known as equidispersion – Variance greater than mean is known as overdispersion When i increases, Poisson distribution approximates normal distribution with mean i and variance i. Binomial distribution with parameter p and index m converges to Poisson distribution with parameter if m  and p  0 (rare events).

76 76 Overdispersion is problem for random variables where variance is related to the mean e.g. binomial, Poisson In case of overdispersion: Var = (1+  ) Negative binomial model [NB1] Var = (1+  ) Negative binomial model [NB2] with  the dispersion parameter (Comeron and Trivedi, 1998, p. 63) Normal random variable has a separate parameter for dispersion (spread around the mean)

77 77 Discrete-time models Probability that event occurs during given episode (interval) (event analysis) –Bernoulli model (Bernoulli random variable) –Binomial model Probability that event occurs in n-th episode (survival analysis) –Geometric model (Geometric random variable)

78 78 Geometric distribution Time at first ‘success’ in series of observations

79 79 Geometric distribution Expected time at first ‘success’: Variance:

80 80

81 81 Negative binomial distribution Time at k-th ‘success’ in series of m observations. Sum of independent and identically distributed geometric random variables It is the product of (i) probability of k-1 ‘successes’ and h ‘failures’ in m-1 (=k-1+h) observations [binomial], and (ii) probability of ‘success’p

82 82 Negative binomial distribution Expected time at k-th ‘success’: Variance:

83 83

84 84


Download ppt "1 1. Observations and random experiments Observations are viewed as outcomes of a random experiment."

Similar presentations


Ads by Google