Question: Statistics 310/732 Assignment 2 Due: 4:00pm, April 5, 2017 Probability density function skills. In the following we will develop your p.d.f. computational skills. 1 Consider
Statistics 310/732 Assignment 2 Due: 4:00pm, April 5, 2017 Probability density function skills. In the following we will develop your p.d.f. computational skills. 1 Consider the function f (x) = 1 x for 1 x c. a Show that c = e for this to be a probability distribution. b Calculate the i median, ii inter-quartile range (IQR = the upper quartile- lower quartile of the distribution), iii mean, and iv variance of this distribution. c Show that a random observation can be generated from the distribution can be generated from this p.d.f. by calculating X = eU where U is a random observation from a Uniform(0, 1) distribution. d Generate 100, 000 observation from this p.d.f. and compute and compare the sample equivalents to the numbers calculated in Question 1b above using R code. Hints: Some Helpful R commands include runif, quantile. 1 Assignment 12, Semester 1, 2016 2 In this question we will develop an alternative to calculating the mean value of a random variable that has a continuous p.d.f f (x) are only defined for non-negative values (x 0) based on its c.d.f. F (x). We will also assume that X has a finite expected value E(X). (Note: This is the continuous analogue to the heroic work you did for the discrete r.v.s for question 4 of assignment 1.) a Firstly let's show that as x , x (1 F (x)) 0 by choosing an arbitrary c > 0 so that compute the expected value E(X) in two parts like so: Z Z c Z xf (x)dx. xf (x)dx + xf (x)dx = E(X) = c 0 0 i Therefore, show that Z c E(X) = Z xf (x)dx + xf (x)dx Z0 c c Z xf (x)dx + c f (x)dx c 0 ii Show that this implies Z c E(X) xf (x)dx + c(1 F (c)). 0 iii Hence, show that Z 0 c(1 F (c)) E(X) c xf (x)dx. 0 iv Hence, show that as c , c (1 F (c)) 0 and so the result follows (by simply replacing c with x). Note this technique is known as sandwiching whereby an expression is sandwiched between two limits that, in this case, equals zero. 2 Assignment 12, Semester 1, 2016 b Consider the formula for non-negative r.vs.: Z (1 F (x))dx. E(X) = 0 Using integration by parts show that this can be re-expressed as: Z 0 (1 F (x))dx = x (1 F (x))\f0 + Z xf (x)dx 0 c Therefore, show that for continuous non-negative for p.d.f. with finite expectation, that: Z (1 F (x))dx. E(X) = 0 3 The Weibull distribution is a distribution that is used a lot in survival analysis and is defined for non-negative x. One (of many) parametrisation of its c.d.f. is x k F (x) = 1 e( ) , for x 0, > 0, and k > 0. Show that its expected value is \u0012 \u0013 1 E(X) = 1 + k Hints: The change of variable technique may Z be needed and remember that the Gamma function if given by (s) = 0 (s + 1) = s(s). 3 us1 eu du and that