rank_corr

# rank_corr - n induce data with correlation xm=zeros(1,nvar...

This preview shows page 1. Sign up to view the full content.

function rc=rank_corr(corr,nsample) % rc=rank_corr(corr,nsample) % induce rank correlation % Iman, R. L., and W. J. Conover. 1982. A Distribution-free Approach to % Inducing Rank Correlation Among Input Variables. % Communications in Statistics B 11:311-334. % Input: % corr : correlation matrix of the variables (nvar,nvar) % nsample : no. of samples % Output: % rc : rank (nsample,nvar) % Budiman (2004) % nvar=length(corr);
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: n % induce data with correlation xm=zeros(1,nvar); xs=ones(1,nvar); R=latin_hs(xm,xs,nsample,nvar); T = corrcoef(R); P = chol(corr)'; Q = chol(T)'; Q % use modified cholesky for corr matrix that is not quite positive definite %[L,D,E]=mchol(corr); %P=L*sqrt(D); %[L,D,E]=mchol(T); %Q=L*sqrt(D); % S = P * inv(Q); RB= R*S'; R for j=1:nvar % rank RB [r,id]=ranking(RB(:,j)); rc(:,j) = r; end...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online