ransamp - % Output: % s : random sample (nsample,nvar) %...

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

View Full Document Right Arrow Icon
function s=ransamp(xmean,xsd,corr,nsample) % s=ransamp(xmean,xsd,corr,nsample) % random sampling with correlation % Input: % xmean : mean of data (1,nvar) % xsd : std.dev of data (1,nvar) % corr : correlation matrix of the variables (nvar,nvar) % nsample : no. of samples
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % Output: % s : random sample (nsample,nvar) % Uses Matlab function: randn % Budiman (2003) % nvar=length(xmean); % random sampling L = chol(corr); z = randn(nvar,nsample); y = L' * z ; s = (y'.*repmat(xsd,nsample,1))+ repmat(xmean,nsample,1);...
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