JosueMA / mateSelectionOptimalStopping

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mate Selection Optimal Stopping

Data

These files are in the data subfolder.

The experimental data are in the MATLAB file MateChoiceApril1st.matwhich contains a single structured variable d with the fields:

                   nProblems: 50
                  nPositions: 15
               nEnvironments: 2
                      values: [50×15×2 double]
                     nValues: 99
            environmentNames: {'female'  'male'}
                   nSubjects: 55
                      gender: [55×1 double]
                         age: [55×1 double]
                    decision: [55×50×2 double]
                   startTime: {1×55 cell}
                    stopTime: {1×55 cell}
                        ages: [18 20 22 24 26 28 30 32 34 36 38 40 42 44 46]
    environmentDistributions: {[15×2 double]  [15×2 double]}
       environmentOrderNames: '1 is female first, 2 is male first'
            environmentOrder: [55×1 double]
                       order: [55×50×2 double]
                   maxChoice: [50×2 double]
           optimalThresholds: {[15×1 double]  [15×1 double]}
                   optChoice: [50×2 double]

The field variables contain the following information

  • nProblems is the number of optimal stopping problems given to each participant in each environment
  • nPositions is the number of alternatives (ages) in each problem
  • ages gives the ages used to label each alternative
  • nEnvironments is the number of environments
  • environmentNames describes the environments
  • valuesgives the value presented for each problem for each alternative in each environment
  • nValues gives the number of unique possible values (there are 99 since the value 100 was not used)
  • maxChoiceis the alternative corresponding to the maximum value for each problem in each environment
  • optChoiceis the alternative corresponding to the the optimal decision process for each problem in each environment
  • optimalThresholds is a cell variable containing a vector for each environment. Each vector lists the sequence of optimal thresholds for that environment.
  • nSubjects is the number of participants in the experiment
  • gender is the gender of each participant (1=female, 2=male)
  • age is the age of each participant in years
  • decision is the option chosen by each participant on each problem in each environment
  • startTimegives the experiment starting time for each participant, in a day and time format
  • stopTimegives the experiment finishing time for each participant, in a day and time format
  • environmentDistributionsis a cell structure containing a matrix for each environment, giving details of the statistical distributions from which values are drawn For each matrix, the rows corresponding to alternatives, the first column corresponding to the mode of the truncated Gaussian distribution, and the second column corresponding to the standard deviation of the truncated Gaussian distribution.
  • environmentOrderis the order in which each participants completed the problems in the environments
  • environmentOrderNames is the coding used to represent the order in which environments were completed
  • orderis the sequence of problems completed by each participant in each environment

Statistical Analysis

These files are in the code subfolder.

  • generateStimuli.m is script for generating a representative set of problems for an environment

  • drawMateChoice.m is a script that draws basic data analysis figures.

    analysisList = { ...
       % 'ProcessOutcomeOptimality'   ; ...
       % 'BeforeAfterChosen'          ; ...
       % 'ChosenInPosition'           ; ...
       % 'Learning'                   ; ...
       % 'IndividualByEnvironment'    ; ...
       % 'ConsolidatedResults'        ; ...
       % 'ConsolidatedResults2'       ; ... 
       % 'ChosenInPosition2'          ; ...
       };
    
  • optimalThresholds.m is a script finds the optimal thresholds for a given environment, and draws the environment, and the environment with the optimal thresholds. It uses the findOptimalThresholds.m function. The following environments are currently included.

    environmentNameList = {...
        % 'marriageFemale' ; ...
        % 'marriageMale'   ; ...
        % 'flat'           ; ...
        % 'test'           ; ...
        % 'airTicket'      ; ...
        };
    

Modeling Analysis

These files are in the model subfolder.

  • optimalPlayer.m is a function that applies the optimal decision process to an environment

    function results = optimalPlayer(mu, sigma, values, goal, nReps)
    % results = optimalPlayer(mu, sigma, values, goal)
    %  characterizes the performance of the optimal player for an optimal
    %  stopping problem in which the presented value from values on each trial
    %  is drawn from truncated Gaussians with means mu and standard deviations sigma
    %  according to a goal of 'min' or 'max', based on nReps simulated problems
    %
    % results.chosen  = the trial chosen by optimal player
    % results.value   = the value chosen by optimal player
    % results.optimal = whether or not the chosen value was maximal
    
  • optimalStoppingPlayerGiven.m is a function that applies a given set of thresholds to an environment

    function results = optimalStoppingPlayerGiven(m, thresholds, goal)
    % results = optimalStoppingPlayerGiven(m, thresholds, goal)
    %  characterizes the performance of a player for given problems
    %  in m according to given thresholds a goal of 'min' or 'max',
    %
    % results.chosen  = the trial chosen by player
    % results.value   = the value chosen by player
    % results.correct = whether or not the chosen value was maximal
    
  • thresholdIndependent.m is a script that applies the general independent-threshold model in thresholdIndependent.txt to data, and generates a variety of analyses and plots. It also saves the posterior predictive descriptive accuracies for each participant to a predy_*.matfile. The analyses and figures are chosen by setting the data and options in the first code block shown below. The results for the drawIndividuals=true plots are in independentThresholdFigures.tar.gz in the figures subfolder.

    % all participants using drawIndividuals = true
    dataName = 'mateChoice2019'; subjectList = 1:55;
    % a subset of select participants using drawSelectIndividuals = true
    % dataName = 'mateChoice2019'; subjectList = [1 8 44]; nRows = 2; nCols = 3; % for draw select individuals option
    
    drawIndividuals = false;
    drawSelectIndividuals = false;
    drawGroup = false;
    
  • cognitiveStrategies.m is a script that applies the cognitive strategies model in the two sequentially-run graphical modelscognitiveStrategies.txt and cognitiveStrategies2.txt to data, and generates a variety of analyses and plots. It uses the functionfindKeepChains.m to retain subsets of MCMC chains, outputStrategyTable.m to generate a latex table of inferred strategies, and the data in optimalStrategies.mat that were generated by the script optimalStrategyParameters.m. The analyses and figures are chosen by setting the data and options in the first code block shown below. The results for the drawIndividuals=true plots are in cognitiveStrategiesFigures.tar.gz in the figures subfolder. (The filenames there show a modelName = threshold_112 which is the development name for the cognitiveStrategies model.)

    % all participants using drawIndividuals = true
    dataName = 'mateChoice2019'; subjectList = 1:55;
    % a subset of select participants using drawSelectIndividuals = true
    % dataName = 'mateChoice2019'; subjectList = [26 13  44]; nRows = 2; nCols = 3; % for draw select individuals option
    
    drawIndividuals = false;
    drawSelectIndividuals = false;
    drawGroup = false;
    drawGroupConditioned = false;
    drawMarginalParams = false;
    drawJointParams = false;
    drawDescriptiveAdequacy = false;
    strategyTable = false;
    

General

These files are in the general subfolder.

  • The data file PantoneSpring2015.mat has a color palette

  • The RAxes.m function modifies the appearance of axes for graphs.

About


Languages

Language:MATLAB 100.0%