Skip to content

Responses and priors

A kernel describes a curve; Response determines what is learned and shared. Read the illustrated kernel guide before selecting a shape. Normal and KernelPrior are R penalties; GP uses Prior inside BayesianPriors instead.

Common kernel operations

Finite response families inherit these operations from the kernel base class:

Operation Result
kernel.evaluate(lags) or kernel(lags) L2-normalized values at a supplied lag array; zero outside finite support. Identity raises because it is an analytic impulse.
kernel.parameters Named scalar shape and lag parameters
kernel.support Finite support endpoints
kernel.metadata Family, parameters, support, normalization and coordinate conventions
kernel.with_parameters(**updates) New immutable kernel with validated parameter updates
kernel.to_coordinates() / kernel.from_coordinates(coordinates) Log coordinates for positive parameters and linear coordinates otherwise

SampledKernel has no free scalar parameters; its supplied arrays describe a fixed curve. Response.free_parameters, parameter_bounds() and support_envelope() expose the resolved learning specification.

Generated from the checked-out source

Signatures, field defaults, and available docstrings below are generated by scripts/build_api_reference.py. Constructor defaults are not a recommendation for every analysis. Semantic choices are explained in the API guide.

Response

from multimodalsrm import Response · Source

Response(
    kernel,
    pooling="partial",
    estimate=True,
    fixed=None,
    bounds=None,
    pooling_strength=1.0,
    lag_prior=None,
    prior=None,
)
Field Type Default
kernel Kernel required
pooling str "partial"
estimate bool True
fixed dict | None None
bounds dict | None None
pooling_strength float 1.0
lag_prior Normal | None None
prior KernelPrior | None None

Configure response sharing and which kernel parameters are learned.

estimate=True learns parameters not listed in fixed. For example, a Gaussian with fixed={"width": 0.4} learns only its lag, while omitting fixed learns both width and lag. estimate=False fixes the full response. pooling="shared" shares a modality's response across people.

Response.lag_only

Response.lag_only(
    kernel,
    *,
    pooling="partial",
    bounds=None,
    pooling_strength=1.0,
    lag_prior=None,
)

Compatibility convenience that fixes every non-lag parameter.

Prefer Response(kernel, estimate=True, fixed={...}) in new examples to make the selected parameters explicit.

Response.initial_kernel

Response.initial_kernel()

Response.free_parameters

Response.free_parameters (property)

Response.parameter_bounds

Response.parameter_bounds()

Response.support_envelope

Response.support_envelope()

Fixed union over bounded family extremes, independent of fit iterates.

Response.metadata

Response.metadata (property)

Identity

from multimodalsrm import Identity · Source

Identity()

Identity.evaluate

Identity.evaluate(lags)

Gaussian

from multimodalsrm import Gaussian · Source

Gaussian(width=1.0, lag=0.0)
Field Type Default
width float 1.0
lag float 0.0

Gaussian.support

Gaussian.support (property)

Gamma

from multimodalsrm import Gamma · Source

Gamma(shape=3.0, scale=1.0, lag=0.0)
Field Type Default
shape float 3.0
scale float 1.0
lag float 0.0

Gamma.support

Gamma.support (property)

DoubleGamma

from multimodalsrm import DoubleGamma · Source

DoubleGamma(
    peak_shape=6.0,
    peak_scale=1.0,
    undershoot_shape=16.0,
    undershoot_scale=1.0,
    undershoot_ratio=1 / 6,
    lag=0.0,
)
Field Type Default
peak_shape float 6.0
peak_scale float 1.0
undershoot_shape float 16.0
undershoot_scale float 1.0
undershoot_ratio float 1 / 6
lag float 0.0

DoubleGamma.support

DoubleGamma.support (property)

BatemanSCR

from multimodalsrm import BatemanSCR · Source

BatemanSCR(rise=0.7, decay=3.0, lag=0.0)
Field Type Default
rise float 0.7
decay float 3.0
lag float 0.0

Causal SCR with two exponential stages and finite continuous L2 scale.

rise and decay are positive time constants in seconds; lag shifts the onset. Equal constants are supported. Exchanging constants leaves the response unchanged: use separated bounds to identify labels. The response ends 90 seconds after lag and uses continuous finite L2 normalization.

BatemanSCR.support

BatemanSCR.support (property)

SampledKernel

from multimodalsrm import SampledKernel · Source

SampledKernel(lags, values)
Field Type Default
lags np.ndarray required
values np.ndarray required

SampledKernel.support

SampledKernel.support (property)

Normal

from multimodalsrm import Normal · Source

Normal(mean, sd)
Field Type Default
mean float required
sd float required

KernelPrior

from multimodalsrm import KernelPrior · Source

KernelPrior(reference, strength)
Field Type Default
reference object required
strength float required

Prior

from multimodalsrm.bayesian import Prior · Source

Prior(family, loc=0.0, scale=1.0, lower=-np.inf, upper=np.inf)
Field Type Default
family str required
loc float 0.0
scale float 1.0
lower float -np.inf
upper float np.inf

Normal or lognormal prior, optionally truncated, or a finite uniform.

For lognormal priors, loc and scale describe log(parameter). The density itself is with respect to the physical parameter. bounded truncates and renormalizes; it does not add a second penalty.

Prior.normal

Prior.normal(mean=0.0, sd=1.0)

Prior.lognormal

Prior.lognormal(log_mean, log_sd)

Prior.uniform

Prior.uniform(lower, upper)

Prior.bounded

Prior.bounded(lower, upper)

Prior.ppf

Prior.ppf(probability)

Prior quantiles for independent, reproducible initial designs.

Prior.distribution

Prior.distribution()

NumPyro distribution; also defines the MAP log density.

BayesianPriors

from multimodalsrm.bayesian import BayesianPriors · Source

BayesianPriors(noise, loading_sd=1.0, offset_sd=1.0, filters=dict())
Field Type Default
noise Prior required
loading_sd float 1.0
offset_sd float 1.0
filters dict dict() (new per instance)

Priors in supplied data units; filter priors map modality then parameter.

noise is a prior on variance, not on standard deviation or log variance. Loading and offset scales are illustrative defaults; applications should set all scales from their measurement units and prior predictive checks.