3.1编写一个函数,它将生成并返回一个随机样本大小为n,有两个参数指数分布Exp(λη)任意n,λ,η。(参见示例2.3和2.6)。生成一个大样本Exp(λη)和比较的样本分位数理论分位数。
3.14 Generate 200 random observations from the 3-dimensional multivariate nor-
mal distribution having mean vector μ = (0,1,2) and covariance matrix
Σ =
[1.0 −0.5 0.5]
[−0.5 1.0 −0.5]
[0.5 −0.5 1.0]
using the Choleski factorization method. Use the R pairs plot to graph an
array of scatter plots for each pair of variables. For each pair of variables,
96 Statistical Computing with R
(visually) check that the location and correlation approximately agree with
the theoretical parameters of the corresponding bivariate normal distribution.
3.15 Write a function that will standardize a multivariate normal sample for arbi-
trary n and d. That is, transform the sample so that the sample mean vector
is zero and sample covariance is the identity matrix. To check your results,
generate multivariate normal samples and print the sample mean vector and
covariance matrix before and after stand=ardization.