#PVL_MLEfitting_IGT.r #This program does the Prospect Valence Learning (PVL), Baseline, & Random Models for the IGT #PVL is the 4-parameter interference version #This program automatically handles data files where the number of trials varies by subject. #It can also handle deck depletion if you modify the cardsperdeck variable. #This program will only model up to the trial where one deck runs out. #Originally programmed by Anthony Bishara for the EVL model (Busemeyer & Stout, 2002). #Visit his homepage @ http://bisharaa.people.cofc.edu/ # #Modified by Woo-Young Ahn for the PVL model (Ahn, Busemeyer, Wagenmakers, & Stout, 2008) #This code estimates 4 free parameters of the PVL model using maximum likelihood estimation #You can try two different learning rules and two different versions of the Luce choice rule #See Ahn et al. (2008) for more details. # Two learning rules: 1. delta-rule, 2: decay-reinforcement (RI) learning rule # Two choice rules: 1. trial-dependent , 2: trial-independent # Bounds of each parameter (different from settings in Ahn et al. (2008) for c and lambda) # A (learning rate): 0.0001 to 0.9999 # alpha: from 0.01 to 1 # lambda: from 0.01 to 5 # -5 < c (sensitivity) < 5 for trial-dependent choice rule # 0 < c (sensitivity) < 5 for trial-independent choice rule #For questions, you can email Woo-Young Ahn (ahnw@indiana.edu) #Instructions: #1) Download and install R from http://www.r-project.org/. When you get to the options, choose "base" and choose the executable file (e.g. R-2.3.1-win32.exe) #2) Run R. #3) In the program, click File, then Change Dir¡¦, then choose the directory your data is in. #4) Use tab-delimated text format for the data. Columns=trial, deck, wins, losses, and subject. # Extra columns after the subject column are okay. # Don't use column labels. #4) Modify the green sections below for your dataset. #5) Select all the text in this document (ctrl+a), then copy and paste into R # or just source the file from R. #6) The output file is labelled "PVL_Results_" plus submodel names and the name of the data file.