test_sampling

test_sampling - corrcoef(r mean(r std(r error in the corr...

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

% example of sampling clear all c nsample=100; % no of random samples to be drawn nvar=6; % no of variables n xmean=[10 5 4 3 20 10]; % mean xsd=[0.1 1 0.1 1 1 1]; % std. deviation % correlation matrix corr=[ 1.00 0 0 0 0 0 0 1.00 0 0 0 0 0 0 1.00 0 0 0 0 0 0 1.00 0.75 -0.70 0 0 0 0.75 1.00 -0.95 0 0 0 -0.70 -0.95 1.00]; % first sample assume no correlation with LHS s=latin_hs(xmean,xsd,nsample,nvar); mean(s) std(s) s pause % sample assume correlation with random sampling r=ransamp(xmean,xsd,corr,nsample);
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: corrcoef(r) mean(r) std(r) % error in the corr. ae=mean(abs(corrcoef(r)-corr)) a pause % sample assume correlation with LHS Stein z=lhs_stein(xmean,xsd,corr,nsample); corrcoef(z) mean(z) std(z) % error in the corr. ae=mean(abs(corrcoef(z)-corr)) a pause % sample assume correlation with LHS Iman z=lhs_iman(xmean,xsd,corr,nsample); mean(z) std(z) corrcoef(z) % error in the corr. ae=mean(abs(corrcoef(z)-corr)) a...
View Full Document

This note was uploaded on 12/10/2009 for the course ME master taught by Professor Mon during the Spring '09 term at Hanyang University.

Ask a homework question - tutors are online