Selection variables

Hi Chris,

As I understand it, now in MWorks 0.5, expressions can be use to specify the parameters of a range replicator.

Can something similar be done with selection variables? In particular, I’d like to do something like

Is this possible or are only literals accepted in selection variable parameters?

Thanks, best,
Mark

Hi Mark,

In MWorks 0.5, you can do almost exactly what you want to do. The only exception is that the “nsamples” parameter must be a literal value, not an expression. However, in this case, you can work around that limitation by changing “sampling_method” to “cycles” and setting “nsamples” to 1. See the attached example.

Cheers,
Chris

Attachment: selection_var.xml (1.66 KB)

Chris,

Thanks for the quick and complete response, as usual.

Just to verify that I understand:
I want the selection variable to allow me to choose values at random without replacement. I think you once said that when sampling_method is “cycles”, nsamples=“1” will do this (go through the list of values exactly once). Correct?

Also, I’m sorry for being a little dense about range replicators, I’m not 100% sure what they do. If I understand correctly here, the range replicator is not required, I can remove it and draw one sample each trial and the selection variable will still return draws at random without replacement from the full list. Is this also correct?

best!
Mark

Hi Mark,

I want the selection variable to allow me to choose values at random without replacement. I think you once said that when sampling_method is “cycles”, nsamples=“1” will do this (go through the list of values exactly once). Correct?

Correct. That’s exactly what my example experiment does.

If I understand correctly here, the range replicator is not required, I can remove it and draw one sample each trial and the selection variable will still return draws at random without replacement from the full list. Is this also correct?

That’s right. You can use a selection variable without a range replicator.

Chris

Great - thank you!
Mark