cardioception.HSD.psi.SynchronyPsi#
- class cardioception.HSD.psi.SynchronyPsi(delays, mu=None, sigma=None, floor=None, peak=None, prior=None, targets=('mu', ), explore=0.0, envelope=<function gaussian_envelope>, rng=None, rise_range=None)[source]#
Posterior over the envelope parameters, and the next delay to test.
- Parameters
- delays
Candidate R-wave-to-tone delays in ms. The procedure chooses among these; the posterior can be updated with any realized delay.
- mu, sigma, floor, peak
Grid values for each parameter. The posterior is discrete on their outer product.
Nonetakesdefault_grids().- prior
Optional array of prior weights over
muonly (same length as themugrid). The prior over the other parameters is uniform; oversigmait is uniform on the supplied grid, so pass a log-spaced grid for a log-uniform prior.Noneis uniform overmu.- targets
The parameters whose marginal posterior entropy the next delay should minimize (Prins, 2013). The others are nuisance parameters that stay in the posterior but do not steer stimulus placement.
("mu",)targets the temporal location alone;("mu", "sigma")adds the width;PARAMETERSreproduces the joint objective of Kontsevich and Tyler.- explore
Probability that a trial ignores the objective and draws a delay uniformly from
delays. Keeps the outer delays sampled, which García-Pérez (2014) notes a pure Bayesian placement does not do.- envelope
Function computing
P(yes | d, mu, sigma, floor, peak). Defaults togaussian_envelope().- rng
Generator used for tie breaking and exploration trials.
- rise_range
(low, high), the delays over whichdetection_evidence()anddetection_bayes_factor()measure the rise of the envelope.Nonemeasures it over the delays presented so far; seerise_range().
- __init__(delays, mu=None, sigma=None, floor=None, peak=None, prior=None, targets=('mu', ), explore=0.0, envelope=<function gaussian_envelope>, rng=None, rise_range=None)[source]#
Methods
__init__(delays[, mu, sigma, floor, peak, ...])ci_width([name, ci])Width of the credible interval of
estimate(): formu, conditioned on a rise while one is supported.converged(width[, name, ci])True once the credible interval for
nameis at mostwidth.detection_bayes_factor([rise])Bayes factor for a rise of more than
riseagainst a flatter one.detection_evidence([rise])Posterior probability that the envelope rises inside the range.
estimate(name[, ci, conditional, rise])Posterior mean, median, mode, SD and central credible interval.
expected_entropy([allowed])Expected posterior entropy of the target marginal after one trial.
marginal(name[, conditional, rise])Posterior over one parameter, on its grid.
next_delay([min_delay, max_delay])The delay to present on the next trial, and whether it was explored.
predicted_envelope([d])Posterior predictive P(yes | d), for plotting against the data.
rise_range()The delay range over which the envelope's rise is measured.
rise_supported([rise])Whether the conditional estimates are conditioned on a rise.
state()Everything needed to resume or re-analyze the session.
summary()estimate()of every parameter, and under"conditional"whethermuandsigmawere conditioned on a rise.update(delay, response[, explored])Condition the posterior on one judgement.
visible_rise()Rise of the envelope inside
rise_range(), per grid point.