ConstBasic usage
const staircase = StairCase({
start: 0,
step: 1,
down: 3,
up: 1,
reversal: 3,
min: 0,
max: 3,
});
for (const value of staircase) {
console.log(value);
// set current trial response to calculate next value
staircase.response(true);
}
// get data after iteration
const threshold = staircase.data
.filter((e) => e.reversal)
.reduce((acc, e, i, arr) => acc + e.value / arr.length, 0);
It will use 1-down-1-up before the first reversal.