Skip to content

Commit 0b9119e

Browse files
authored
Update README.md
1 parent ae91434 commit 0b9119e

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ MATLAB toolbox for Bayesian analysis of behavioural strategies on choice tasks
44
Pre-print: https://doi.org/10.1101/2022.08.30.505807
55

66
Tested with: MATLAB R2017a onwards
7+
78
Requires: Statistics and Machine Learning Toolbox
89

910
## Top-level scripts
@@ -21,6 +22,13 @@ Four scripts demonstrate the main use of the Toolbox:
2122
- Development/: scripts used in testing code for bugs, including unit-tests of strategy models [toolbox functionality does not need this folder]
2223

2324
# How do I use the toolbox with my data?
24-
1. Put your data into a format that can be read into a Table using "readtable" - see any of the top-level scripts for examples. For example, a CSV file. Ensure to include the command to write the Table entries as strings: readtable(<name of your data file>,'TextType','string').
25-
2. Use Replicate_Figure1 as a template. Make a copy (e.g. My_Strategy_Analysis.m). Edit that copy to load your data (in the format of Step 1) and select the strategies you want to apply (in the string "strategues = ["go_left",...,]); then run it and see the results
26-
3. Write your own strategy models: see the Strategy_models/ folder for examples, and a template. All strategy model functions have the same input (rows of the data Table up to the current trial) and output (the trial type as a string). Then simply add the name of the new function to your list of strategies in your script. And run it!
25+
1. Put your data into a file format (e.g. a CSV file) that can be read into a Table using the built-in MATLAB function "readtable" - see any of the top-level scripts for examples. Ensure to include the command to write the Table entries as strings: readtable("name of your data file",'TextType','string').
26+
2. Use Replicate_Figure1 as a template. Make a copy (e.g. My_Strategy_Analysis.m). Edit that copy to load your data (in the format of Step 1) and select the strategies you want to apply (in the string "strategies = ["go_left",...,]); then run it and see the results
27+
3. Write your own strategy models: see the Strategy_models folder for examples and a template. All strategy model functions have the same input (rows of the data Table up to the current trial) and output (the trial type as a string). Then simply add the name of the new function to your list of strategies in your script. And run it!
28+
29+
# Things to be aware of
30+
- Names and values of data variables: the supplied strategy models assume that the loaded dataset uses the following names and values for each variable: Choice ("left","right'), Reward ("yes","no"), CuePosition ("left","right").
31+
32+
- Omissions: the supplied strategy functions assume the subject made a choice on each trial. If your data contain trials with omissions (e.g. the subject did not engage on that trial) then either (a) remove those trials from the dataset before using the strategy analysis on them, or (b) edit the code to handle how you coded the omissions in your data. For example, if you coded an omission as Choice = NaN, then assign any trial with Choice = NaN as a "null" trial-type for *every* strategy; the best place to do that would be in the top-level script -- an if/else that checked first whether the trial was an omission, and then only evaluated the trial-type for each strategy if it was not an omission.
33+
34+

0 commit comments

Comments
 (0)