test_sampling - corrcoef(r) mean(r) std(r) % error in the...

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

View Full Document Right Arrow Icon
% 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);
Background image of page 1
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

Ask a homework question - tutors are online