This is the code of the computational model for manuscript "Cost-benefit Tradeoff Mediates the Transition from Rule-based to Memory-based Processing during Practice" by Guochun Yang & Jiefeng Jiang.

Software requirement: Matlab

Installation guide: No installation needed.

Instruction to run the data: The basic model scripts are within folders "Models_avatar" and "Models_avatar_decreasingcost". The former includes the key model while the latter is an alternative model to compare.

To run the models with data within the "behdata" folder, run the ModelAnalysis.mlx file.

As indicated by the names, Model_comparison.mlx is used to do the model comparison across alternative models; Model_plots.xls is used to do plot the model comparison and model prediction results; transition_switchcost_behavior.mlx is used to do the transition effect analysis.

Functions within the "basic" folder are used in doing statistical analyses.

Expected outputs are shown besides each cell of the mlx script.

Note: The models' orders (M0-M5) are not the same as the variable "imodel" used in the scripts due to some reorganization during drafting.