Replies: 1 comment 1 reply
-
I don't think you can do this with the https://www.jspsych.org/overview/timeline/#custom-sampling-function |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm trying to figure out, how to update the value of sample size for a block of trials. I have two kinds of blocks and I want their size (amount of trials in them) to be a randomly sampled number from [11,12,13,14,15] so that it would be resampled after every block.
In my current attempts, I managed to generate a random value for sampler, but it would be the same fixed value throughout the experiment:
generate amount of trials for block 1, by sampling randomly from 10:15
var size1 = jsPsych.randomization.sampleWithReplacement([10,11,12,13,14,15],1)[0];
generate amount of trials for block 2 by sampling randomly from 10:15
var size2 = jsPsych.randomization.sampleWithReplacement([10,11,12,13,14,15],1)[0];
define block 1
var easy_block = {
timeline: [experimental_trial],
timeline_variables: easy_params,
sample: {
type: 'with-replacement',
size: size1,
weights: [0.25,0.25,0.75,0.75],
}}
define block 2
var hard_block = {
timeline: [experimental_trial],
timeline_variables: hard_params,
sample: {
type: 'with-replacement',
size: size2,
weights: [0.25,0.25,0.75,0.75],
}}
combine blocks into timeline
var blocks = [hard_block, easy_block];
var experimental_timeline = jsPsych.randomization.repeat(blocks, 4)
add to final procedure
experimental_procedure = {
timeline: experimental_timeline,
};
How would I go about resampling the values for size1 and size2 after every block? :)
Beta Was this translation helpful? Give feedback.
All reactions