CL_stat — Statistics on a matrix of samples
[means,cov] = CL_stat(samples)
matrix of sample values. It represents N samples of a vector of P variables. (PxN)
vector of means (means(i) is the mean of samples(i,:)) (Px1)
covariance matrix (PxP)
//given correlation in cartesian coordinates, compute correlation in adapted circular parameters with Monte Carlo process bulletin = [-1877901 -3909428 -5026025 7428.157 -1541.857 -1576.532]'; //position and velocity cor = [1 -0.467016 -0.447601 0.960396 0.987145 0.995826;... 0 1 -0.088751 -0.359696 -0.412472 -0.540655;... 0 0 1 -0.248472 -0.582834 -0.431908;... 0 0 0 1 0.915197 0.943178;... 0 0 0 0 1 0.980679;... 0 0 0 0 0 1]; //correlation matrix cor = cor+cor'-eye(cor); //complete correlation matrix (symmetric) sd = [15939.68154 2912.099353 3079.494708 6.81910416 9.50017639 12.14624495]'; //standard deviations cov = CL_cor2cov(cor,sd); drawn_car = CL_covDraw(bulletin,cov,10000); //draw 10000 samples following correlation drawn_cir = CL_oe_car2cir(drawn_car(1:3,:),drawn_car(4:6,:)); //convert samples to adapted circular par. [mean_cir,cov_cir] = CL_stat(drawn_cir);