<< CL_cov2cor Utilities CL_cross >>

CelestLab >> Utilities > CL_covDraw

CL_covDraw

Random values from covariance

Calling Sequence

[values] = CL_covDraw(means,cov,num)

Description

Parameters

means :

Vector of expectations (Nx1)

cov:

Covariance matrix (NxN)

num :

(integer) Number of random samples to draw

values :

Matrix containing the random samples. Each sample is a column vector. The number of columns is num. (NxP)

Authors

See also

Examples

// draw 10000 position samples knowing 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);  // drawn values

// estimate mean values and covariance from samples
[pos2, cov2] = CL_stat(drawn_pos);
<< CL_cov2cor Utilities CL_cross >>