top of page

STAT3023 Statistical Inference

For solutions, purchase a LIVE CHAT plan or contact us

Report due 11:59PM 25 August 2022.

1. (a) Generate 100 realisations of the sample variance of 10 independent N(0,1)
random variables and store them in s2.
(b) Plot the histogram of (10-1)*s2 and overlay it with the density function of
the χ 2
9
distribution (use dchisq).
(c) Repeat (a) and (b) with n = 60 independent N(0,1) random variables. Over-
lay the histogram with both the density curve of χ 2
n−1
and the density curve
of N(n − 1,2(n − 1)) (in two different colours). Comment on the fit.
(d) For n = 60, compute P((n − 1) · S 2 > 68) using both the exact distribution
(χ 2
n−1 ) and the normal approximation. Compare the results.
2. (a) When two random variables (X,Y ) follow a bivariate normal distribution, the
covariance matrix Σ is defined as
Σ =
?
σ 2
1
ρσ 1 σ 2
ρσ 1 σ 2 σ 2
2
?
,
where ρ is the correlation, σ 2
1 ,σ
2
2
are the variances of X and Y respectively.
Use mvrnorm from the MASS library (use library(MASS)) to generate 100
samples from a bivariate normal distribution with µ = (µ 1 ,µ 2 ) with µ 1 = 2,
µ 2 = 3, and Σ =
? 1
1
1 4
?
. Call the first column x and the second column y.
(b) Plot the histogram of x and overlay it with the corresponding marginal normal
density. Repeat for y. (Recall the marginal distribution of X is N(µ 1 ,σ 2
1 ).)
(c) Produce a scatter plot of x and y (use plot). Compute the sample correlation
coefficient (use cor) and compare with the population correlation ρ. (First
work out ρ in the Σ given.)
3. (a) Generate 100 realizations of the uniform U(0,1) distribution and store it in
u. Apply the transformation z = −log u. Verify that z is a sample from an
exponential(1) distribution by plot the histogram of z and overlay it with the
density of the distribution.
(b) Generate 100 realisations of the minimum of 10 independent exponential(1)
random variables. Note the rate parameter in rexp is defined as the reciprocal
the expectation (check the density function in the help file ?rexp).
(c) Plot the histogram and overlay it with the density of exponential(1/10) (rate=10)
distribution. Comment on the fit.

For solutions, purchase a LIVE CHAT plan or contact us

Limited time offer:

Follow us on Instagram and tag 10 friends for a $50 voucher! No minimum purchase required.

bottom of page