Code covered by the BSD License  

Highlights from
modified randsample

Be the first to rate this file! 6 Downloads (last 30 days) File Size: 1.46 KB File ID: #27263

modified randsample

by Jean-Luc Dellis

 

16 Apr 2010 (Updated 16 Apr 2010)

same than randsample but Without Replacement and with Weighting

| Watch this File

File Information
Description

v=randsampleWRW(x,k,w)

Returns V, a weigthed sample of K elements taken among X without replacement
X a vector of numerics
K amount of element to sample from x
W a vector of positive weights w, whose length is length(x)

% EXAMPLE:
% for i=1:100
% v(i)=randsampleWRW([0,0.5,3,20],1,[0.5,0.4,0.05,0.05]);
% end
% plot(v,'o')

Required Products Statistics Toolbox
MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
16 Apr 2010

a bug has been corrected

Tag Activity for this File
Tag Applied By Date/Time
randsample replacement weighting Jean-Luc Dellis 16 Apr 2010 11:28:08

Contact us at files@mathworks.com