Simulation¶
This module is to simulate whole data sets.
You can chose to simulate with the same parameters for the whole set or provide different parameters by subject. In the simulate_sample
function we sample from PyDream posteriors.
Example Simulation¶
Full Simulation Doc¶
Simulate data
-
scenewalk.simulation.simulate_dataset.
simulate
(dur_dat, im_dat, densities_dat, sw_model, params=None, start_loc='center', x_path=None, y_path=None, resample_durs=False, verbose=False, save_to=None, custom_id=None)¶ simulate and save dataset given durations and images
- Parameters
- dur_datarray
duration vector Subjects[Images[Scanpath[]]]
- im_datarray
image numbers vector (starts at 1) - densities_dat : 128x128px densities in the order of number reference
- sw_modelscenewalk model object
scenewalk object (if using only one param combination for the whole simulation, pass object with preset param values)
- params{None, dict}
if None, just use whatever is in the scenewalk object. Otherwise pass a dictionary of all the parameters your model needs
- start_loc{“center” or “data”}
start location of each trial
- x_path{None, Array}
if start_loc is set to data, provide x positions of the data
- y_path: {None, Array}
if start_loc is set to data, provide y positions of the data
- resample_dursbool
set to true if you want durations to be sampled from a fitted gamma distribution for each subject. If False, it uses empirical fixation durations.
- verbosebool
set to true for basic progress printing
- save_tostr
folder to save the simulation to. If none, it makes a folder in the working directory, named with the simulation id.
- custom_idstr
simulation id. if none it gets a timestamp.
- Returns
- str
simulation id number
-
scenewalk.simulation.simulate_dataset.
simulate_sample
(dur_dat, im_dat, densities_dat, sw_model, chains_dict, sample_level, start_loc='center', x_path=None, y_path=None, resample_durs=False, verbose=False, save_to=None, custom_id=None)¶ simulates dataset given durations and images but sample from the posterior parameter distribution.
- Parameters
- dur_datarray
duration vector Subjects[Images[Scanpath[]]]
- im_datarray
image numbers vector (starts at 1) - densities_dat : 128x128px densities in the order of number reference
- sw_modelscenewalk model object
scenewalk object (if using only one param combination for the whole simulation, pass object with preset param values)
- chains_dictdict
pass estimated posteriors in a dictionary to sample from
- sample_level{“vp”, “trial”, “fix”}
how often do we sample? every subject, every trial, or every fixation?
- params{None, dict}
if None, just use whatever is in the scenewalk object. Otherwise pass a dictionary
- start_loc{“center” or “data”}
start location of each trial
- x_path{None, Array}
if start_loc is set to data, provide x positions of the data
- y_path: {None, Array}
if start_loc is set to data, provide y positions of the data
- resample_dursbool
set to true if you want durations to be sampled from a fitted gamma distribution for each subject. If False, it uses empirical fixation durations.
- verbosebool
set to true for basic progress printing
- save_tostr
folder to save the simulation to. If none, it makes a folder in the working directory, named with the simulation id.
- custom_idstr
simulation id. if none it gets a timestamp.
- Returns
- str
simulation id number