JND
Constructor Summary
Public Constructor | ||
public |
constructor(Parameters: assoc array) Initializes a JND experiment object. |
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
graph_type: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
subject_id: * |
|
public |
|
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
calculate_adjusted_value(constants: *): * Calculates the adjusted value depending on whether this is the first trial of the sub condition or not. |
|
public |
check_response(data: JsPsych.data): boolean Given a JND trial data, determines whether response is correct or not. |
|
public |
Determines whether the current sub condition can end or not. |
|
public |
When called, will save aggregated trial data into a CSV. |
|
public |
When called, will save individual trial data into a CSV. |
|
public |
generate_adjusted_distribution(constants: *, adjusted_value: *): object Generates the adjusted distribution depending on the type of task. |
|
public |
generate_trial(type: *): * Generates a JND trial object for use in the JsPsych timeline. |
|
public |
get_next_adjusted_correlation(last_JND_trial: object): double Calculates the next adjusted correlation (the traditional way). |
|
public |
get_next_adjusted_statistic(last_JND_trial: object): double Calculates the next adjusted value. |
|
public |
handle_data_saving(trial: *) Handles saving the relevant data on a given trial. |
|
public |
initialize_adjusted_statistic(constants: object): double Initializes the adjusted value for the first time. |
|
public |
Determines whether current subcondition has converged or not. |
|
public |
Checks whether we have just started a subcondition. |
|
public |
prepare_experiment(balancing_type: *) Orders the input data according to balancing type and initializes the JND object's variables. |
|
public |
prepare_practice(dataset: *) Orders the input dataset by randomizing it, and initializes the practice variables. |
Public Constructors
public constructor(Parameters: assoc array) source
Initializes a JND experiment object.
Params:
Name | Type | Attribute | Description |
Parameters | assoc array | passed from routing. |
Public Members
public PIXELS_PER_CM: * source
public adjusted_quantity_matrix: {} source
public balancing_type: * source
public condition_group: * source
public condition_name: * source
public graph_type: * source
public practice_conditions_constants: * source
public raw_constants: * source
public sub_condition_order: * source
public sub_conditions_constants: * source
public subject_id: * source
public subject_initials: * source
public trial_structure: * source
Public Methods
public calculate_adjusted_value(constants: *): * source
Calculates the adjusted value depending on whether this is the first trial of the sub condition or not.
Params:
Name | Type | Attribute | Description |
constants | * | {assoc array} |
Return:
* | adjusted_value {double} |
public check_response(data: JsPsych.data): boolean source
Given a JND trial data, determines whether response is correct or not.
Params:
Name | Type | Attribute | Description |
data | JsPsych.data | @param. {object} constants |
public end_sub_condition(): boolean source
Determines whether the current sub condition can end or not.
public generate_adjusted_distribution(constants: *, adjusted_value: *): object source
Generates the adjusted distribution depending on the type of task. If no task is specified, defaults to using correlation.
Params:
Name | Type | Attribute | Description |
constants | * | ||
adjusted_value | * |
public generate_trial(type: *): * source
Generates a JND trial object for use in the JsPsych timeline.
Params:
Name | Type | Attribute | Description |
type | * | {string} "test" or "practice" |
Return:
* | trial {object} |
public get_next_adjusted_correlation(last_JND_trial: object): double source
Calculates the next adjusted correlation (the traditional way).
Params:
Name | Type | Attribute | Description |
last_JND_trial | object | . {object} constants |
Return:
double | next_adjusted_statistic |
public get_next_adjusted_statistic(last_JND_trial: object): double source
Calculates the next adjusted value.
Params:
Name | Type | Attribute | Description |
last_JND_trial | object | . {object} constants |
Return:
double | next_adjusted_statistic |
public handle_data_saving(trial: *) source
Handles saving the relevant data on a given trial.
For reference, these are the helper variables created to assist in trial logic (i.e not present in excel)
trial_variables =
{type: 'jnd',
run_type: '',
left_correlation: '',
right_correlation: '',
};
These are variables created WITHIN the trial logic that were not present in excel (but need to be
outputted to results).
export_variables =
{sub_condition: '', // Chronological ordering of sub_condition [1, 2, 3 ... ]
balanced_sub_condition: '', // Index of sub_condition according to balancing order
jnd: '',
base_correlation: '',
adjusted_value: '',
correct: '',
};
Params:
Name | Type | Attribute | Description |
trial | * | {object} block_type {string} "test" or "practice" constants {assoc array} index {integer} adjusted_value {double} |
public initialize_adjusted_statistic(constants: object): double source
Initializes the adjusted value for the first time.
Params:
Name | Type | Attribute | Description |
constants | object |
Return:
double | adjusted_value |
public is_converged_in_window(): boolean source
Determines whether current subcondition has converged or not.
public is_start_of_subcondition(): boolean source
Checks whether we have just started a subcondition.
public prepare_experiment(balancing_type: *) source
Orders the input data according to balancing type and initializes the JND object's variables.
Params:
Name | Type | Attribute | Description |
balancing_type | * | {string} Type of balancing. Currently only latin_square is supported. dataset {[{assoc array}, {assoc array}, ... ]} The data to be ordered. |
public prepare_practice(dataset: *) source
Orders the input dataset by randomizing it, and initializes the practice variables.
Params:
Name | Type | Attribute | Description |
dataset | * | {[{assoc array}, {assoc array}, ... ]} The data to be ordered. |