Skip to content

hssm.likelihoods

Likelihood functions and distributions that use them.

hssm.likelihoods.logp_ddm

logp_ddm(data: ndarray, v: float, a: float, z: float, t: float, err: float = 1e-15, k_terms: int = 20, epsilon: float = 1e-15) -> ndarray

Compute analytical likelihood for the DDM model with sv.

Computes the log-likelihood of the drift diffusion model f(t|v,a,z) using the method and implementation of Navarro & Fuss, 2009.

Parameters:

  • data (ndarray) –

    data: 2-column numpy array of (response time, response)

  • v (float) –

    Mean drift rate. (-inf, inf).

  • a (float) –

    Value of decision upper bound. (0, inf).

  • z (float) –

    Normalized decision starting point. (0, 1).

  • t (float) –

    Non-decision time [0, inf).

  • err (float, default: 1e-15 ) –

    Error bound.

  • k_terms (int, default: 20 ) –

    number of terms to use to approximate the PDF.

  • epsilon (float, default: 1e-15 ) –

    A small positive number to prevent division by zero or taking the log of zero.

Returns:

  • ndarray

    The analytical likelihoods for DDM.

hssm.likelihoods.logp_ddm_bbox

logp_ddm_bbox(data: ndarray, v, a, z, t) -> ndarray

Compute blackbox log-likelihoods for ddm models.

hssm.likelihoods.logp_ddm_sdv

logp_ddm_sdv(data: ndarray, v: float, a: float, z: float, t: float, sv: float, err: float = 1e-15, k_terms: int = 20, epsilon: float = 1e-15) -> ndarray

Compute the log-likelihood of the drift diffusion model f(t|v,a,z).

Using the method and implementation of Navarro & Fuss, 2009.

Parameters:

  • data (ndarray) –

    2-column numpy array of (response time, response)

  • v (float) –

    Mean drift rate. (-inf, inf).

  • a (float) –

    Value of decision upper bound. (0, inf).

  • z (float) –

    Normalized decision starting point. (0, 1).

  • t (float) –

    Non-decision time [0, inf).

  • sv (float) –

    Standard deviation of the drift rate [0, inf).

  • err (float, default: 1e-15 ) –

    Error bound.

  • k_terms (int, default: 20 ) –

    number of terms to use to approximate the PDF.

  • epsilon (float, default: 1e-15 ) –

    A small positive number to prevent division by zero or taking the log of zero.

Returns:

  • ndarray

    The log likelihood of the drift diffusion model with the standard deviation of sv.

hssm.likelihoods.logp_ddm_sdv_bbox

logp_ddm_sdv_bbox(data: ndarray, v, a, z, t, sv) -> ndarray

Compute blackbox log-likelihoods for ddm_sdv models.

hssm.likelihoods.logp_full_ddm

logp_full_ddm(data: ndarray, v, a, z, t, sz, sv, st)

Compute blackbox log-likelihoods for full_ddm models.