view m-toolbox/classes/+utils/@math/corr2cov.m @ 28:01b86b780ba7
database-connection-manager
Remove LTPDARepositoryManager implementation. Java code
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Mon, 05 Dec 2011 16:20:06 +0100 (2011-12-05)
parents
f0afece42f48
children
line source
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ − % CORR2COV
+ − % Convert correlartion matrix to covariance matrix
+ − %
+ − % SigC Vector of length n with the standard deviations of each process. n
+ − % is the number of random processes.
+ − %
+ − % CorrC n-by-n correlation coefficient matrix. If ExpCorrC is not
+ − % specified, the processes are assumed to be uncorrelated, and the identity
+ − % matrix is used.
+ − %
+ − % Algorithm
+ − %
+ − % Covar(i,j) = CorrC(i,j)*(SigmC(i)*SigmC(j)
+ − %
+ − % L Ferraioli 10-10-2010
+ − %
+ − % $Id: corr2cov.m,v 1.1 2010/11/16 16:41:37 luigi Exp $
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ −
+ −
+ − function Covar = corr2cov(CorrC,SigC)
+ −
+ − Covar = CorrC;
+ −
+ − for tt=1:size(CorrC,1)
+ − for hh=1:size(CorrC,2)
+ − Covar(tt,hh) = CorrC(tt,hh)*SigC(tt)*SigC(hh);
+ − end
+ − end
+ − end