Skip to content

SMosegaard/DecisionMaking_exam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👩‍🎓 Decision Making Exam

Adapting the Conditional Cooperation Model: Evaluating its Application in One-shot Public Goods Games

This repository contains the code for my exam project in the course 'Decision making' as a part of my Master in Cognitive Science, Aarhus University.

🔧 Setup and installation

1. Clone the repository

Start by cloning the repository to your local machine using the following command:

$ git clone "https://github.com/SMosegaard/DecisionMaking_exam.git"
$ cd DecisionMaking_exam/src

2. Install JAGS

Install JAGS using the following command:

$ sudo apt update
$ sudo apt install jags

3. Restore the R Environment

To restore the package environment, run the following command in your R console:

$ renv::restore()

👩‍💻 Usage

Once the environment is restored, you are ready to run the analysis. Below are the steps for different stages of the project:

1. Parameter recovery

Run the following scripts to perform parameter recovery for both models:

$ Rscript hier_CC_recovery.R
$ Rscript hier_CC_recovery_no_rho.R

2. Parameter estimation

To perform parameter estimation for both models, use:

$ Rscript group_estimation.R
$ Rscript group_estimation_no_rho.R

3. Group comparison

Finally, run these scripts to perform group comparison:

$ Rscript group_comparison.R
$ Rscript group_comparison_no_rho.R

📂 Repo overview

The project structure is as follows:

.
├── jags_output/     # Contains BUGS objects, MPD values, and summary tables
├── plots/           # Stores all plots generated by the scripts in the src/ folder
├── renv/            # The reproducible environment for the R project
├── src/             # Includes the main R scripts for parameter recovery, estimation, and group comparison
    ├── CC.R
    ├── CC_no_rho.R
    ├── CC.txt
    ├── CC_no_rho.txt
    ├── hier_CC_recovery.R
    ├── hier_CC_recovery_no_rho.R
    ├── group_estimation.R
    ├── group_estimation_no_rho.R
    ├── group_comparison.txt
    ├── group_comparison_no_rho.txt
    ├── group_comparison.R
    ├── group_comparison_no_rho.R
    └──plot_functions.R
├── .gitignore 
├── DecisionMaking_exam.Rproj
└── README.md

⚠️ Notes

  • R version: This project was developed and tested using R version 4.4.1 To check your current R version, run R --version in your terminal.
  • Platform: This analysis was written and executed on the interactive HPC system UCloud using a standard machine with 8 CPU. Performance may vary depending on your system specifications.
  • Run time: The parameter recovery step will take around 1.5 hour per model to complete, while the parameter estimation and group comparison scripts run significantly faster, typically just a few minutes.

About

GitHub repository that contains code for the exam in the course "Decision Making" - Msc Cognitive Science, 1st semester

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages