The Role of Sensorimotor Contingencies and Eye Scanpath Entropy in Presence in Virtual Reality: A Reinforcement Learning Paradigm
This repository contains the materials used for the data analysis of:
Küçüktütüncü, Macia-Varela, Llobera & Slater (2025) The Role of Sensorimotor Contingencies and Eye Scanpath Entropy in Presence in Virtual Reality: A Reinforcement Learning Paradigm accepted at IEEE Transactions on Visualization and Computer Graphics (TVCG)
A preprint of the publication can be found [The Role of Sensorimotor Contingencies and Eye Scanpath Entropy in Presence in Virtual Reality: A Reinforcement Learning Paradigm]
The scripts found here can also be run directly online, in Kaggle, using the following links:
-
Basic data analysis and formating (in python): Suplementary material for Küçüktütüncü et al. | Kaggle
-
Statistical model to analyse the transitions (in R): Transitions Analysis | Kaggle
The analysis of the transitions data that is at the heart of the statistical analysis described in the paper.
- Analysis of the scanpath data including the computation of entropy (in R): Scanpath | Kaggle
You must first download this repository to a local directory. The scripts running locally have three parts, each explained below.
To run the R scripts containing the statistics and the stan model for the transitions analysis, you should do the following (only tested in mac):
- Install R
- Install the latest RStudio
Note: on os X make sure you also have the latest Xtools to avoid problems with the compilation of Stan models
- In RStudio you have to go to Session -> Set Working Directory -> Project Directory and point to the folder in the repository called "transitions_analysis"- so that all files referred to are now local instead of having to put full path names.
- Open the file called modeldata_publication.R
- You should not run this file as a whole - but rather copy each successive line to the RStudio console and execute it
Note: During this process you will see that there are other libraries to install (like rstan and expm).
- At the end of running this script, you should get the result that corresponds to Table 7 of the publication.
To run the scripts and the stan model corresponding to the scanpath analysis, you should:
- In RStudio you have to go to Session -> Set Working Directory -> Project Directory and point to the folder in the repository called "scanpath"- so that all files referred to are now local instead of having to put full path names.
- If you have run the transition analysis you should also select Session -> New session to remove the variables previously created
- Open the file called scanpath.R
- Run this file step by step
- At the end of running this script you should get the result that corresponds to figure 6 of the publication.
If instead of using the table results_transitions.csv you want to generte it from raw data, you will need to run the python notebook. .
To do so, put the terminal in folder "3.process_raw_data". Also, make sure you have miniconda or anaconda installed. Open a terminal (mac, linux), or a conda powershell (windows) and do the following:
> conda env create -f environment.yml
> conda activate rl-sm-vr
> jupyter notebook
Then in the browser open the jupyter notebook called suplementary-material-for-k-kt-t-nc-et-al.ipynb, and then select the menu option Run > Run all cels
This should create all the tables needed for the data analysis. In particular, the table results_transitions.csv, which is used as input for the Stan model in section 1.
It will also generate some preliminary plots not included in the final publication, used as a sanity check.