TimescalePupil#
- class pypillometry.sim.TimescalePupil(params=None, timescales=('3 s', '10 s', '30 s', '100 s', '300 s'), nu=1.5, binocular=False, cutoff='10 s', eyes=None)[source]#
Bases:
SimStepLatent pupil size from the timescale model (see
TimescaleModel): a fast component (Matérn-3/2) and slow components (“atoms”) at fixed time scales, in log-%.- Parameters:
params (
dict|None) – parameters on their natural scale, as for one unit inTimescaleModel.params:fast_sd(log-%),fast_ell(ms) and the standard deviation of each atom (sd_3s,sd_10s, …; log-%); for two eyes with binocular alsodiff_sd,diff_ell(the difference between the eyes) andgain(of the common components in the second eye relative to the first). Missing parameters are the centre of the general prior (seegeneral_prior()); the noise (noise_sd) is ignored (seeWhiteNoise).timescales (
tuple) – time scales of the atoms (plain numbers are ms); default 3, 10, 30, 100 and 300 snu (
float) – smoothness of the atoms (default 1.5)binocular (
bool) – if True, the eyes share the fast component and the atoms and differ by a difference component (needs two eyes); if False (default), each eye is drawn independently with the same parameterscutoff (
str) – time scale from which on the atoms count as slow, for the ground truthlog_slow(plain numbers are ms; default 10 s)eyes (
tuple|None) – eyes the step applies to (default: all eyes of the simulation)
Notes
Ground truth per eye (log-%):
log_size(the latent signal),log_fast, one entry per atom (log_3s, …),log_slow(the atoms from cutoff) and, if binocular,log_diff;log_sizeis the sum of the components.Examples
The components of five minutes of the latent pupil size:
>>> import pypillometry as pp >>> d = pp.sim.Simulation("5 min", fs=20, seed=1, name="TimescalePupil").pupil().run() >>> fig = d.plot.plot_components()
Methods
change the arrays of the running simulation run
bankthe eyes of the simulation the step applies to
the step from
to_dict()the events and the duration (ms), for steps of stage
"events"parameter vector of bank (the noise is negligible)
name and parameters of the step (numbers, strings, lists, dicts)
Details
- generate(rng)#
the events and the duration (ms), for steps of stage
"events"