simulateMvMatrix: Simulate a Multivariate Matrix Based on a Specified Rank... In EnvStats: Package for Environmental Statistics, Including US EPA Guidance

Description

Simulate a multivariate matrix of random numbers from specified theoretical probability distributions and/or empirical probability distributions based on a specified rank correlation matrix, using either Latin Hypercube sampling or simple random sampling.

Details

Motivation
In risk assessment and Monte Carlo simulation, the outcome variable of interest, say Y, is usually some function of one or more other random variables:

Y = h(\underline{X}) = h(X_1, X_2, …, X_k) \;\;\;\;\;\; (1)

For example, Y may be the incremental lifetime cancer risk due to ingestion of soil contaminated with benzene (Thompson et al., 1992; Hamed and Bedient, 1997). In this case the random vector \underline{X} may represent observations from several kinds of distributions that characterize exposure and dose-response, such as benzene concentration in the soil, soil ingestion rate, average body weight, the cancer potency factor for benzene, etc. These distributions may or may not be assumed to be independent of one another (Smith et al., 1992; Bukowski et al., 1995). Often, input variables in a Monte Carlo simulation are in fact known to be correlated, such as body weight and dermal area.

Characterizing the joint distribution of a random vector \underline{X}, where different elements of \underline{X} come from different distributions, is usually mathematically complex or impossible unless the elements (random variables) of \underline{X} are independent. Iman and Conover (1982) present an algorithm for creating a set of n multivariate observations with a rank correlation matrix that is approximately equal to a specified rank correlation matrix. This method allows for different probability distributions for each element of the multivariate vector. The details of this algorithm are as follows.

Algorithm

1. Specify n, the desired number of random vectors (i.e., number of rows of the n \times k output matrix). This is specified by the argument n for the function simulateMvMatrix.

2. Create C, the desired k \times k correlation matrix. This is specified by the argument cor.mat.

3. Compute P, where P is a lower triangular k \times k matrix and

PP^{'} = C \;\;\;\;\;\; (2)

where P^{'} denotes the transpose of P. The function simulateMvMatrix uses the Cholesky decomposition to compute P (see the R help file for chol).

4. Create R, an n \times k matrix, whose columns represent k independent permutations of van der Waerden scores. That is, each column of R is a random permutation of the scores

Φ^{-1}(\frac{i}{n+1}), \; i = 1, 2, …, n \;\;\;\;\;\; (3)

where Φ denotes the cumulative distribution function of the standard normal distribution.

5. Compute T, the k \times k Pearson sample correlation matrix of R. Make sure T is positive definite; if it is not, then repeat step 4.

6. Compute Q, where Q is a lower triangular k \times k matrix and

QQ^{'} = T \;\;\;\;\;\; (4)

The function simulateMvMatrix uses the Cholesky decomposition to compute Q (see the R help file for chol).

7. Compute the lower triangular k \times k matrix S, where

S = PQ^{-1} \;\;\;\;\;\; (5)

8. Compute the matrix R^{*}, where

R^{*} = RS^{'} \;\;\;\;\;\; (6)

9. Generate an n \times k matrix of random numbers \underline{X}, where each column of \underline{X} comes from the distribution specified by the arguments distributions and param.list. Generate each column of random numbers independently of the other columns. If the j'th element of sample.method equals "SRS", use simple random sampling to generate the random numbers for the j'th column of \underline{X}. If the j'th element of sample.method equals "LHS", use Latin Hypercube sampling to generate the random numbers for the j'th column of \underline{X}. At this stage in the algorithm, the function simulateMvMatrix calls the function simulateVector to create each column of \underline{X}.

10. Order the observations within each column of \underline{X} so that the order of the ranks within each column of \underline{X} matches the order of the ranks within each column of R^{*}. This way, \underline{X} and R^{*} have exactly the same sample rank correlation matrix.

Explanation
Iman and Conover (1982) present two algorithms for computing an n \times k output matrix with a specified rank correlation. The algorithm presented above is the second, more complicated one. In order to explain the reasoning behind this algorithm, we need to explain the simple algorithm first.

Simple Algorithm
Let R_i denote the i'th row vector of the matrix R, the matrix of scores. This row vector has a population correlation matrix of I, where I denotes the k \times k identity matrix. Thus, the 1 \times k vector R_i P^{'} has a population correlation matrix equal to C. Therefore, if we define R^{*} by

R^{*} = RP^{'} \;\;\;\;\;\; (7)

each row of R^{*} has the same multivariate distribution with population correlation matrix C. The rank correlation matrix of R^{*} should therefore be close to C. Ordering the columns of \underline{X} as described in Step 10 above will yield a matrix of observations with the specified distributions and the exact same rank correlation matrix as the rank correlation matrix of R^{*}.

Iman and Conover (1982) use van der Waerden scores instead of raw ranks to create R because van der Waerden scores yield more "natural-looking" pairwise scatterplots.

If the Pearson sample correlation matrix of R, denoted T in Step 5 above, is exactly equal to the true population correlation matrix I, then the sample correlation matrix of R^{*} is exactly equal to C, and the rank correlation matrix of R^{*} is approximately equal to C. The Pearson sample correlation matrix of R, however, is an estimate of the true population correlation matrix I, and is therefore “bouncing around” I. Likewise, the Pearson sample correlation matrix of R^{*} is an estimate of the true population correlation matrix C, and is therefore bouncing around C. Using this simple algorithm, the Pearson sample correlation matrix of R^{*}, as R^{*} is defined in Equation (7) above, may not be “close” enough to the desired rank correlation matrix C, and thus the rank correlation of R^{*} will not be close enough to C. Iman and Conover (1982), therefore present a more complicated algorithm.

More Complicated Algorithm
To get around the problem mentioned above, Iman and Conover (1982) find a k \times k lower triangular matrix S such that the matrix R^{*} as defined in Equation (6) above has a correlation matrix exactly equal to C. The formula for S is given in Steps 6 and 7 of the algorithm above.

Iman and Conover (1982, p.330) note that even if the desired rank correlation matrix C is in fact the identity matrix I, this method of generating the matrix will produce a matrix with an associated rank correlation that more closely resembles I than you would get by simply generating random numbers within each column of \underline{X}.

Value

A numeric matrix of dimension n \times k of random numbers, where the j'th column of numbers comes from the distribution specified by the j'th elements of the arguments distributions and param.list, and the rank correlation of this matrix is approximately equal to the argument cor.mat. The value of n is determined by the argument n, and the value of k is determined by the length of the argument distributions.

Note

Monte Carlo simulation and risk assessment often involve looking at the distribution or characteristics of the distribution of some outcome variable that depends upon several input variables (see Equation (1) above). Usually these input variables can be considered random variables. An important part of both sensitivity analysis and uncertainty analysis involves looking at how the distribution of the outcome variable changes with changing assumptions on the input variables. One important assumption is the correlation between the input random variables.

Often, the input random variables are assumed to be independent when in fact they are know to be correlated (Smith et al., 1992; Bukowski et al., 1995). It is therefore important to assess the effect of the assumption of independence on the distribution of the outcome variable. One way to assess the effect of this assumption is to run the Monte Carlo simulation assuming independence and then also run it assuming certain forms of correlations among the input variables.

Iman and Davenport (1982) present a series of scatterplots showing “typical” scatterplots with various distributions on the x- and y-axes and various assumed rank correlations. These plots are meant to aid in developing reasonable estimates of rank correlation between input variables. These plots can easily be produced using the simulateMvMatrix and plot functions.

Author(s)

Steven P. Millard ([email protected])

References

Bukowski, J., L. Korn, and D. Wartenberg. (1995). Correlated Inputs in Quantitative Risk Assessment: The Effects of Distributional Shape. Risk Analysis 15(2), 215–219.

Hamed, M., and P.B. Bedient. (1997). On the Effect of Probability Distributions of Input Variables in Public Health Risk Assessment. Risk Analysis 17(1), 97–105.

Iman, R.L., and W.J. Conover. (1980). Small Sample Sensitivity Analysis Techniques for Computer Models, With an Application to Risk Assessment (with Comments). Communications in Statistics–Volume A, Theory and Methods, 9(17), 1749–1874.

Iman, R.L., and W.J. Conover. (1982). A Distribution-Free Approach to Inducing Rank Correlation Among Input Variables. Communications in Statistics–Volume B, Simulation and Computation, 11(3), 311–334.

Iman, R.L., and J.M. Davenport. (1982). Rank Correlation Plots For Use With Correlated Input Variables. Communications in Statistics–Volume B, Simulation and Computation, 11(3), 335–360.

Iman, R.L., and J.C. Helton. (1988). An Investigation of Uncertainty and Sensitivity Analysis Techniques for Computer Models. Risk Analysis 8(1), 71–90.

Iman, R.L. and J.C. Helton. (1991). The Repeatability of Uncertainty and Sensitivity Analyses for Complex Probabilistic Risk Assessments. Risk Analysis 11(4), 591–606.

McKay, M.D., R.J. Beckman., and W.J. Conover. (1979). A Comparison of Three Methods for Selecting Values of Input Variables in the Analysis of Output From a Computer Code. Technometrics 21(2), 239–245.

Millard, S.P. (2013). EnvStats: an R Package for Environmental Statistics. Springer, New York. http://www.springer.com/book/9781461484554.

Smith, A.E., P.B. Ryan, and J.S. Evans. (1992). The Effect of Neglecting Correlations When Propagating Uncertainty and Estimating the Population Distribution of Risk. Risk Analysis 12(4), 467–474.

Thompson, K.M., D.E. Burmaster, and E.A.C. Crouch. (1992). Monte Carlo Techniques for Quantitative Uncertainty Analysis in Public Health Risk Assessments. Risk Analysis 12(1), 53–63.

Vose, D. (2008). Risk Analysis: A Quantitative Guide. Third Edition. John Wiley & Sons, West Sussex, UK, 752 pp.