general_prior#

pypillometry.signal.gaussmarkov.general_prior(bank=None, strength='medium')[source]#

General prior for the pupil size in log-% (\(100 \log(x / \mathrm{median})\)), derived from recordings of several experiments.

The prior describes how the parameters of the timescale-bank model vary between recordings: 155 recordings of four experiments with desk-mounted and portable EyeLink trackers (tasks of 20 to 47 minutes). Its centre is a fast component with a standard deviation of 8 log-% and a length scale of 0.7 s, noise of 0.2 log-%, and atoms with standard deviations of 3.3, 5.0, 2.0, 2.2 and 3.7 log-% at 3, 10, 30, 100 and 300 s. The fast component and the noise vary little between recordings (by a factor of 1.3 to 1.7), the variances of the atoms a lot (standard deviations of \(u = \log(v + v_0)\) of 1.8 to 2.7).

The data of a recording determine the fast component, the noise and the total slow variance, so that the prior matters for what they do not determine: the variance of atoms that carry little of it, and the split of the variance between neighbouring atoms. It keeps these in a plausible range instead of at zero or at very large values.

Parameters:
  • bank (TimescaleBank, optional) – the model; default: the default bank. For time scales other than the default ones, the prior of the atoms is interpolated over the log time scale.

  • strength ({"weak", "medium", "strong"} or float) –

    • "medium" (default): the distribution of the parameters over the recordings

    • "strong": the same with half the standard deviations

    • "weak": with twice the standard deviations

    • a number: with the standard deviations multiplied by it

Return type:

GaussianPrior

Returns:

independent normal distributions of the entries of theta

Examples

>>> prior = general_prior(strength="weak")
>>> prior.names[:3]
['log_fast_sd', 'log_fast_ell', 'log_noise_sd']
>>> bool(np.allclose(prior.sd, 4 * general_prior(strength="strong").sd))
True