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. None takes default_grids().

prior

Optional array of prior weights over mu only (same length as the mu grid). The prior over the other parameters is uniform; over sigma it is uniform on the supplied grid, so pass a log-spaced grid for a log-uniform prior. None is uniform over mu.

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; PARAMETERS reproduces 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 to gaussian_envelope().

rng

Generator used for tie breaking and exploration trials.

rise_range

(low, high), the delays over which detection_evidence() and detection_bayes_factor() measure the rise of the envelope. None measures it over the delays presented so far; see rise_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(): for mu, conditioned on a rise while one is supported.

converged(width[, name, ci])

True once the credible interval for name is at most width.

detection_bayes_factor([rise])

Bayes factor for a rise of more than rise against 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" whether mu and sigma were 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.