GithubHelp home page GithubHelp logo

sappelhoff / sp_experiment Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 2.0 1.89 MB

Experiment code for the `mpib_sp_eeg` experiment

Home Page: https://github.com/sappelhoff/sp_experiment/

License: BSD 3-Clause "New" or "Revised" License

Python 99.75% Makefile 0.25%
experiment psychology eeg neuroscience psychopy tobii tobii4c 4c eyetracking

sp_experiment's Issues

Replay shows data from error trials

in the passive condition of the experiment, we draw on an already saved event log of an active condition run.

Errors that happened in the active condition run should be completely disregarded in the passive condition replay, however currently this is not the case.

Example

  1. subj-A does active condition
  2. in their trial 1, they commit a mistake after the 3rd sample (wait too long), so the trial is reset and they start new (with new reward distributions)
  3. thus, they have N + 3 samples in their dataframe for that trial
  4. The +3 samples most likely contain outcomes that are not part of the outcomes of the new reward distribution
  5. hence, a participant yoked to subj-A can in their passive condition and in the described trial, get more than the usual maximum of two outcomes per option (e.g., 3 or even 4).

This happens rarely enough, but it must be fixed!

BUG: Lotteries shown in "description" task do not necessarily correspond to those in the "active" task

When analyzing the behavioral data and plotting the expected value differences in the different conditions (active-fixed: AF, active-variable: AV, yoked-fixed: YF, yoked-variable:YV, description: DESC), I noticed the following:

  • EV differences are NOT always the same between the description task, and the corresponding active task by subject (sometimes AF, sometimes AV)

The following figure prompted my investigation of this issue:

  • "true" EV diff should always be at 0.9, except for the DESC task ✔️
  • "experienced" and "true" EV should be the same for DESC task ✔️
  • EV diffs for DESC task should be "a mixture" of EV diffs of the two active tasks (AF, AV)❌

image

This was due to several small mistakes, but the general error boils down to:

  • when preparing the sampled outcomes from an active task to be displayed as a description task, the ordering of magnitudes and probabilities was sometimes different.
  • Example: a 1-90%, 4-10% could become a 1-10%, 4-90%
  • Example: a 5-100% could become a 1-100%
    • this example needs some explanation: when only a single outcome was encountered in an option, the outcomes of that option were substituted with a code value of 98 (appended) that occurred with a probability of 0. Later in the pipeline, those values with a probability of 0 would not be shown. Now in the case of the example, the magnitude of 5 with 100% was exchanged with the magnitude 1 with a probability 0 (because in this particular example, the 98 code replaced a 1 outcome that never occurred) ... so a 1 is shown with 100% although it was never encountered, and the 5 is not even listed in the description task

Two smaller bug fixes make this error more unlikely to occur:

  • 1fa12d2 ... to prevent np.unique from sorting values
  • f09dece ... to save outcomes from the active task in order of occurrence

and one bug fix solves this issue completely (even without the two smaller bug fixes above):

  • 7704a05 ... to always match a magnitude with its corresponding probability

What does this mean?

This means that each participant did SOME trials of their DESC task with lotteries that did NOT match the lotteries they experienced in their active task version.

Next step is to find out how many trials in the DESC task are affected by this per participant. --> For some trials, we will have had the correct data displayed "by chance" ... i.e., in some cases the bug would have no effect on ordering.

events.json --> events_json.py

turn the json file into a python file that produces a JSON

... once that is done: import values from the define_ttl_values.py script ... and make that script a single function that returns the values

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.