Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: times
See also:

Quantlet: normalcorr
Description: generates correlated pseudo random normal variates using the Cholesky factorization.

Usage: x = normalcorr(n,C)
Input:
n scalar, time, n represents the number of observations to be generated in each series
C p x q matrix, correlation matrix, e.g. obtained with corr()
Output:
x ( n, sqrt(size(C)) )-dimensional array, containing the simulated trajectories

Example:
library("multi")
library("times")
randomize(100)
C = reshape(#(1,0.5,0.5,1),#(2,2))
x = normalcorr(200,C)	; simulation of correlated normal variates
corr(x)

Result:
Contents of r

[1,]        1  0.52418
[2,]  0.52418        1

Note:         The output vectors (x) approximately have a correlation
structure defined by C.



Author: R. Weron, 20040521 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006