Name
CL_covDraw — Draw samples from covariance
Calling Sequence
[drawnValues] = CL_covDraw(meanValues,cov,N)
Description
-
Computes N randomly drawn samples of P correlated variables using Cholesky factorisation.
Correlation between variables is given by the covariance matrix (cov) .
The expectation or mean of each variable is also needed (meanValues).
- Last update : 19/11/2009
Parameters
- meanValues:
vector of expectation or mean values (Px1)
- cov:
covariance matrix
- N :
number of random samples to draw
- drawnValues:
matrix containing N randomly drawn samples of P correlated variables (PxN)
Examples
//draw 10000 samples of position parameters given the covariance matrix.
pos = [-1877901 -3909428 -5026025]'; //position
cov = [1.0 -0.46 -0.44;-0.46 1.0 -0.43;-0.44 -0.43 1.0];
[drawn_pos] = CL_covDraw(pos,cov,10000); //draw values randomly