AllenNeuralDynamics / aind-dynamic-foraging-models

behavioral models for the dynamic foraging task
MIT License
0 stars 0 forks source link

Migrate Sue's Stan code to this repo #1

Open hanhou opened 4 months ago

hanhou commented 4 months ago
hanhou commented 4 months ago

@rachelstephlee @ZhixiaoSu feel free to track stan-related analysis here.

ZhixiaoSu commented 2 months ago

Parameter recovery capsule: https://codeocean.allenneuraldynamics.org/capsule/1509373/tree Sim&Fit notebook does simulation, fit the stan model, and saves the results to scratch folder. Recovery notebook checks parameter recovery based on saved data.

Current status:

  1. Stan fitting works as expected, with model correctly compiled.
  2. Parameter recovery works reasonably well on animal level.
  3. Session-level parameters are bias towards animal-level parameters. To do:
  4. Start with uncoupled-unbaited task, find a trial number 'threshold' where parameter recovery goes off to see if we can run shorter sessions of 75 min (maximum around 600 trials).
  5. Add in function to do session data model fitting.
rachelstephlee commented 1 month ago

Rachel will deal with the file savings.

Right now NWB's are in a temporary format so model information will be saved in a separate folder with the animal name as the title.

Rachel will edit the stanParamsRecovery capsule to save it.

The data with NWB (only simulated data on the capsule for now) is foraging_nwb_bonsai

rachelstephlee commented 1 month ago

Notebook Sim&Fit (fits simulated data)-- change simulated data with the foraging_nwb_bonsai. outputs the samples and summary stats

Recovery will get the decision variables. Will want them for the animal level params and the session level params (hierarchical fit)

Need to combine to save the summary stats, samples, and decision variables altogether.

@ZhixiaoSu will give me code that organizes animals by sessions and well as the criterion for cutting out sessions.

ZhixiaoSu commented 1 month ago

@rachelstephlee The first few cells in this capsule in behavior_qc notebook have examples of loading the data from the foraging dataset. https://codeocean.allenneuraldynamics.org/capsule/1773804/tree

For simple criterion, let's start with: Foraging efficiency > 0.6 (in nwb.scratch['metadata']) Finish rate > 0.7 (choice~=2) Total number of choices > 300