# QuestHandler

## data QuestHandler

A Trial Handler that implements the Quest algorithm for quick measurement of psychophysical thresholds. QuestHandler relies on the `jsQuest` library, a port of Prof Dennis Pelli's QUEST algorithm by `Daiichiro Kuroki`.

## Constructor

#### new QuestHandler(options)

Source:
  - data/QuestHandler.js, line 19

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | Object | the handler options ###### Properties
Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`psychoJS` | module:core.PsychoJS |  |  | the PsychoJS instance
`varName` | string |  |  | the name of the variable / intensity / contrast / threshold manipulated by QUEST
`startVal` | number |  |  | initial guess for the threshold
`startValSd` | number |  |  | standard deviation of the initial guess
`minVal` | number |  |  | minimum value for the threshold
`maxVal` | number |  |  | maximum value for the threshold
`pThreshold` | number | <optional> | `0.82` | threshold criterion expressed as probability of getting a correct response
`nTrials` | number |  |  | maximum number of trials
`stopInterval` | number |  |  | minimum [5%, 95%] confidence interval required for the loop to stop
`method` | QuestHandler.Method |  |  | the QUEST method
`beta` | number | <optional> | `3.5` | steepness of the QUEST psychometric function
`delta` | number | <optional> | `0.01` | fraction of trials with blind responses
`gamma` | number | <optional> | `0.5` | fraction of trails that would generate a correct response when the threshold is infinitely small
`grain` | number | <optional> | `0.01` | quantization of the internal table
`name` | string |  |  | name of the handler
`autoLog` | boolean | <optional> | `false` | whether or not to log

### Extends

- TrialHandler

### Members

#### (static, readonly) Method :Symbol

Source:
  - data/QuestHandler.js, line 354

##### Properties:

Name | Type | Description
--- | --- | ---
`QUANTILE` | Symbol | Quantile threshold estimate.
`MEAN` | Symbol | Mean threshold estimate.
`MODE` | Symbol | Mode threshold estimate.

QuestHandler method

##### Type:

- Symbol

#### intensity

Source:
  - data/QuestHandler.js, line 233

Get the current value of the variable / contrast / threshold.

This is the getter associated to getQuestValue.

### Methods

#### (protected) _estimateQuestValue()

Source:
  - data/QuestHandler.js, line 284

Estimate the next value of the QUEST variable, based on the current value and on the selected QUEST method.

#### (protected) _setupJsQuest()

Source:
  - data/QuestHandler.js, line 266

Setup the JS Quest object.

#### addResponse()

Source:
  - data/QuestHandler.js, line 119

Add a response and update the PDF.

#### confInterval()

Source:
  - data/QuestHandler.js, line 244

Get an estimate of the 5%-95% confidence interval (CI).

#### getQuestValue() → {number}

Source:
  - data/QuestHandler.js, line 221

Get the current value of the variable / contrast / threshold.

##### Returns:

the current QUEST value for the variable / contrast / threshold

Type
  number

#### mean() → {number}

Source:
  - data/QuestHandler.js, line 179

Get the mean of the Quest posterior PDF.

##### Returns:

the mean

Type
  number

#### mode() → {number}

Source:
  - data/QuestHandler.js, line 199

Get the mode of the Quest posterior PDF.

##### Returns:

the mode

Type
  number

#### quantile() → {number}

Source:
  - data/QuestHandler.js, line 211

Get the standard deviation of the Quest posterior PDF.

##### Returns:

the quantile

Type
  number

#### sd() → {number}

Source:
  - data/QuestHandler.js, line 189

Get the standard deviation of the Quest posterior PDF.

##### Returns:

the standard deviation

Type
  number

#### setMethod(method, log)

Source:
  - data/QuestHandler.js, line 95

Setter for the method attribute.

##### Parameters:

Name | Type | Description
--- | --- | ---
`method` | mixed | the method value, PsychoPy-style values ("mean", "median", "quantile") are converted to their respective QuestHandler.Method values
`log` | boolean | whether or not to log the change of seed

#### simulate()

Source:
  - data/QuestHandler.js, line 162

Simulate a response.