lhsu - % Budiman (2003) % nvar=length(xmin);...

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

View Full Document Right Arrow Icon
function s=lhsu(xmin,xmax,nsample) % s=lhsu(xmin,xmax,nsample) % LHS from uniform distribution % Input: % xmin : min of data (1,nvar) % xmax : max of data (1,nvar) % nsample : no. of samples % Output: % s : random sample (nsample,nvar)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % Budiman (2003) % nvar=length(xmin); ran=rand(nsample,nvar); s=zeros(nsample,nvar); for j=1: nvar idx=randperm(nsample); P =(idx'-ran(:,j))/nsample; s(:,j) = xmin(j) + P.* (xmax(j)-xmin(j)); end...
View Full Document

Ask a homework question - tutors are online