Jump to content

rnd-sample with :replace parameter


Recommended Posts

I understand from initial testing, that currently rnd-sample works what statisticians call sampling with replacement.

 

Is this correct (please forgive me if I missed something in the doc) ?

 

I guess the current behavior covers most musical cases, as long as you want to get a sample which holds some mix of elements in SEQUENCE. There might be cases where you want a slightly different behaviour especially if N is close to length of SEQUENCE.

 

If I am correct, I suggest to implement a parameter :replace (by default t (true) for backward compatibility) to define a behavior where the elements from SEQUENCE are not replaced.

 

For :replace set to nil:

If N exceeds length of SEQUENCE then an error is raised.

If N equals the length of SEQUENCE then simply all elements are returned.

 

Regards

Cliff

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy