None of these.
question id: seahorse-catch-cotton
π‘ Loading...
Exercise 1 The functions dunif()
, dnorm()
, and dexp()
, respectively, implement the uniform, gaussian, and exponential families of distributions. The word βfamilyβ is used because each each family has it is own parameters:
Pick 3 very different sets of parameters for each family. (They should be meaningful, for instance sd
Exercise 2 Plot out dnorm()
on semi-log axis. You can choose your own mean and sd, and your graphics domain should cover at least mean
dnorm(x)
will never be zero for any finite x
.
Exercise 3
dexp()
is a scaled version of
None of these.
question id: seahorse-catch-cotton
Exercise 4 Count the grid squares under the probability density functions in XREF not implemented yet and use the fact that the total area under a probability density function is always 1 to estimate the area of a single grid square in each graph. Make sure to give units, if any.
Exercise 5 The cumulative distribution translates the probability density into an actual probability (a number between zero and one). Formally, the cumulative distribution is
Active R chunk 5 plots the cumulative probability function of dexp(t, rate = 1/100)
, corresponding to the probability of a 100-year storm. Evaluating rate = 0.01
,
11%
27%
39%
51%
question id: goat-sit-knob-1
about 30 years
50 years
about 70 years
100 years
about 130 years
question id: goat-sit-knob-2
Exercise 6
The code in Active R chunk 5 creates the anti-derivative of a particular probability density function. The cumulative probability function at any x
will be P(x) - P(Inf)
.
Plot out the cumulative probability function P(x) - P(Inf)
over the domain
Exercise 7 In the Social Security life-table M2014F
, one column is nliving
. The nliving
variable is computed by tracking the age-specific mortality rate as it plays out in a hypothetical population of 100,000 newborns. The age-specific mortality rate at age 0 is applied the the 100,000 to calculate the number of deaths in the first year: 531. Therefore 99,469 survive to age 1. Then the age-specific mortality rate at age 1 is applied to the 99,469 survivors to calculate the number of deaths of one-year olds: 34. This leaves 99,434 surviving two-year olds. (There is round-off error, involved, which is why the number is not 99,435.) The process is continued up through age 120, at which point there are no survivors.
The following R code constructs from M2014F
a function died_before(age)
giving the fraction of the cohort of 100,000 who died at or before the given age
.
died_before(age)
vs age
. Explain what you see in the graph that tells you that this is a cumulative probability function.
To calculate life-expectancy, we need to convert died_before(age)
into died_at(age)
, the probability density of death at any given age. Use R/mosaic to construct died_at(age)
, which will be a basic calculus transformation of died_before()
.
died_at(age)
function?
No units
year
year-1
age
question id: seal-tug-mattress-2
Find the expectation value of age
under the probability density died_at(age)
. This is called the life-expectancy at birth: the average number of years of life of the people in the imaginary cohort of 100,000.
M2014F
data?question id: seal-tug-mattress-3
Exercise 8 Exponential distributions are self similar. Looking at ?fig-exponential-density and assume that
Hint: Make sure that the sum of these probability masses does not exceed 1.
Exercise 9 Calculate symbolically the expectation value and variance of the uniform distribution with parameters
Exercise 10 The code in Active R chunk 6 will construct a function, prob_death60(age)
that gives the probability that a person reaching her 60th birthday will die at any given age. (The function is constructed from US Social Security administration data for females in 2014.)
age - 60
.) Compute the life-expectancy at age 60 based on the prob_death(age)
function.lower.bound=60
in antiD()
so that the value will be zero at age 60.) From the cumulative, find the median age of death for those reaching age 60. (Hint: Zeros()
.)prob_death60()
. You can do this by scaling prob_death60()
by