Skip to content

Instantly share code, notes, and snippets.

@steveharoz
Created August 19, 2016 15:03
Show Gist options
  • Save steveharoz/dafc7e2100d43006b7536ea1c5838b2d to your computer and use it in GitHub Desktop.
Save steveharoz/dafc7e2100d43006b7536ea1c5838b2d to your computer and use it in GitHub Desktop.
Psychometric function target - what y value on a psychometric function will a staircase hit
downRule = 3 # How many correct answers in a row do you need to drop down a level?
upRule = 1 # How many incorrect answers in a row do you need to step up a level?
stepSizeDown = .25 # If the current staircase value is 1, how much do you subtract to get to the next level down?
stepSizeUp = 1 / (1 - stepSizeDown) - 1 # This assumes that staircase values are fixed
ratio = stepSizeUp / (stepSizeDown + stepSizeUp)
exponent = downRule / upRule
inverseExponent = 1 / exponent # because we're solving in reverse
# the percent correct target
ratio ^ inverseExponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment