cm.rnorm.cor {CreditMetrics}R Documentation

Computation of correlated standard normal distributed random numbers

Description

cm.rnorm.cor computes correlated standard normal distributed random numbers. This function uses a correlation matrix rho and later the cholesky decompositon in order to get the correlated random numbers.

Usage

cm.rnorm.cor(N, n, rho)

Arguments

N number of simulations
n number of simulated random numbers
rho correlation matrix

Details

This function computes standard normal distributed random numbers which include the correlation matrix rho. One has a random matrix Y which is N(0,1) distributed. With the linear transformation X = μ + A Y one gets X is N(μ, A A^T) distributed. If X should have the correlation matrix Σ. By using the cholesky decomposition the matrix A can be computed from Σ.

Value

The function returns N simulations with n simulated random numbers each which include the correlation matrix rho.

Author(s)

Andreas Wittmann andreas_wittmann@gmx.de

References

Glasserman, Paul, Monte Carlo Methods in Financial Engineering, Springer 2004

See Also

eigen, chol, cm.rnorm

Examples

  N <- 3
  n <- 50000
  firmnames <- c("firm 1", "firm 2", "firm 3")
  
  # correlation matrix
  rho <- matrix(c(  1, 0.4, 0.6,
                  0.4,   1, 0.5,
                  0.6, 0.5,   1), 3, 3, dimnames = list(firmnames, firmnames),
                  byrow = TRUE)
  
  cm.rnorm.cor(N, n, rho)

[Package CreditMetrics version 0.0-1 Index]