Skip to content

Theoretical Models

kriterion.models

Model

Model(data: ROCData)

Bases: ABC

Source code in src/kriterion/models.py
def __init__(self, data: ROCData) -> None:
    self.data = data

compute_expected abstractmethod

compute_expected(
    smooth: bool = False,
) -> tuple[ndarray, ndarray]

Expected cumulative proportions under the current parameter values.

All subclasses must implement this method.

PARAMETER DESCRIPTION
smooth

If True, evaluate over a dense criterion grid for plotting rather than at the observed rating boundaries, by default False.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
tuple[ndarray, ndarray]

(noise, signal) cumulative proportions.

Source code in src/kriterion/models.py
@abstractmethod
def compute_expected(self, smooth: bool = False) -> tuple[np.ndarray, np.ndarray]:
    """Expected cumulative proportions under the current parameter values.

    All subclasses must implement this method.

    Parameters
    ----------
    smooth : bool, optional
        If True, evaluate over a dense criterion grid for plotting rather
        than at the observed rating boundaries, by default False.

    Returns
    -------
    tuple[np.ndarray, np.ndarray]
        `(noise, signal)` cumulative proportions.
    """

roc

roc() -> tuple[ndarray, ndarray]

Smooth ROC curve for plotting.

Evaluates the model over a dense criterion grid rather than the observed rating boundaries.

RETURNS DESCRIPTION
tuple[ndarray, ndarray]

(noise, signal) cumulative proportions over the dense grid.

Source code in src/kriterion/models.py
def roc(self) -> tuple[np.ndarray, np.ndarray]:
    """Smooth ROC curve for plotting.

    Evaluates the model over a dense criterion grid rather than the
    observed rating boundaries.

    Returns
    -------
    tuple[np.ndarray, np.ndarray]
        `(noise, signal)` cumulative proportions over the dense grid.
    """
    return self.compute_expected(smooth=True)

ContinuousModel

ContinuousModel(data: ROCData)

Bases: Model

Base class for models with continuous criterion parameters.

Extends Model with a set of free criterion locations \(c_k\).

ATTRIBUTE DESCRIPTION
criteria

Criterion locations \(c_k\), one per rating boundary, initialised to a uniform grid over \([-1.5, 1.5]\).

TYPE: ndarray

Source code in src/kriterion/models.py
def __init__(self, data: ROCData) -> None:
    super().__init__(data)
    self._init_criteria()

compute_expected abstractmethod

compute_expected(
    smooth: bool = False,
) -> tuple[ndarray, ndarray]

Expected cumulative proportions under the current parameter values.

All subclasses must implement this method.

PARAMETER DESCRIPTION
smooth

If True, evaluate over a dense criterion grid for plotting rather than at the observed rating boundaries, by default False.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
tuple[ndarray, ndarray]

(noise, signal) cumulative proportions.

Source code in src/kriterion/models.py
@abstractmethod
def compute_expected(self, smooth: bool = False) -> tuple[np.ndarray, np.ndarray]:
    """Expected cumulative proportions under the current parameter values.

    All subclasses must implement this method.

    Parameters
    ----------
    smooth : bool, optional
        If True, evaluate over a dense criterion grid for plotting rather
        than at the observed rating boundaries, by default False.

    Returns
    -------
    tuple[np.ndarray, np.ndarray]
        `(noise, signal)` cumulative proportions.
    """

roc

roc() -> tuple[ndarray, ndarray]

Smooth ROC curve for plotting.

Evaluates the model over a dense criterion grid rather than the observed rating boundaries.

RETURNS DESCRIPTION
tuple[ndarray, ndarray]

(noise, signal) cumulative proportions over the dense grid.

Source code in src/kriterion/models.py
def roc(self) -> tuple[np.ndarray, np.ndarray]:
    """Smooth ROC curve for plotting.

    Evaluates the model over a dense criterion grid rather than the
    observed rating boundaries.

    Returns
    -------
    tuple[np.ndarray, np.ndarray]
        `(noise, signal)` cumulative proportions over the dense grid.
    """
    return self.compute_expected(smooth=True)

HighThreshold

HighThreshold(data: ROCData)

Bases: Model

High-threshold detection model.

Signal responses are modelled as a mix of true detection with probability \(R\) and guessing with probability \((1-R)G\):

\[ H_k = R + (1 - R) \cdot F_k \]
ATTRIBUTE DESCRIPTION
R

Detection probability, \(0 \leq R \leq 1\).

TYPE: float

Source code in src/kriterion/models.py
def __init__(self, data: ROCData) -> None:
    super().__init__(data)
    self.R = 0.99

roc

roc() -> tuple[ndarray, ndarray]

Smooth ROC curve for plotting.

Evaluates the model over a dense criterion grid rather than the observed rating boundaries.

RETURNS DESCRIPTION
tuple[ndarray, ndarray]

(noise, signal) cumulative proportions over the dense grid.

Source code in src/kriterion/models.py
def roc(self) -> tuple[np.ndarray, np.ndarray]:
    """Smooth ROC curve for plotting.

    Evaluates the model over a dense criterion grid rather than the
    observed rating boundaries.

    Returns
    -------
    tuple[np.ndarray, np.ndarray]
        `(noise, signal)` cumulative proportions over the dense grid.
    """
    return self.compute_expected(smooth=True)

SignalDetection

SignalDetection(data: ROCData)

Bases: ContinuousModel

Equal-variance signal detection model1.

Signal and noise are modelled as Gaussian distributions with equal variance, separated by sensitivity \(d'\):

\[ H_k = \Phi\left(\frac{d'}{2} - c_k\right), \quad F_k = \Phi\left(-\frac{d'}{2} - c_k\right) \]

where \(\Phi\) is the standard normal CDF and \(c_k\) are the criterion locations.

ATTRIBUTE DESCRIPTION
d

Sensitivity \(d'\).

TYPE: float

criteria

Criterion locations \(c_k\), one per rating boundary.

TYPE: ndarray

Source code in src/kriterion/models.py
def __init__(self, data: ROCData) -> None:
    super().__init__(data)
    self.d = 1.0

roc

roc() -> tuple[ndarray, ndarray]

Smooth ROC curve for plotting.

Evaluates the model over a dense criterion grid rather than the observed rating boundaries.

RETURNS DESCRIPTION
tuple[ndarray, ndarray]

(noise, signal) cumulative proportions over the dense grid.

Source code in src/kriterion/models.py
def roc(self) -> tuple[np.ndarray, np.ndarray]:
    """Smooth ROC curve for plotting.

    Evaluates the model over a dense criterion grid rather than the
    observed rating boundaries.

    Returns
    -------
    tuple[np.ndarray, np.ndarray]
        `(noise, signal)` cumulative proportions over the dense grid.
    """
    return self.compute_expected(smooth=True)

UnequalSignalDetection

UnequalSignalDetection(data: ROCData)

Bases: ContinuousModel

Unequal-variance signal detection model.

Extends the equal-variance model by allowing the signal distribution to have standard deviation \(\sigma_s \neq 1\):

\[ H_k = \Phi\left(\frac{d'/2 - c_k}{\sigma_s}\right), \quad F_k = \Phi\left(-\frac{d'}{2} - c_k\right) \]

where \(\Phi\) is the standard normal CDF and \(c_k\) are the criterion locations.

ATTRIBUTE DESCRIPTION
d

Sensitivity \(d'\).

TYPE: float

signal_sd

Standard deviation \(\sigma_s\) of the signal distribution.

TYPE: float

criteria

Criterion locations \(c_k\), one per rating boundary.

TYPE: ndarray

Source code in src/kriterion/models.py
def __init__(self, data: ROCData) -> None:
    super().__init__(data)
    self.d = 1.0
    self.signal_sd = 1.5

roc

roc() -> tuple[ndarray, ndarray]

Smooth ROC curve for plotting.

Evaluates the model over a dense criterion grid rather than the observed rating boundaries.

RETURNS DESCRIPTION
tuple[ndarray, ndarray]

(noise, signal) cumulative proportions over the dense grid.

Source code in src/kriterion/models.py
def roc(self) -> tuple[np.ndarray, np.ndarray]:
    """Smooth ROC curve for plotting.

    Evaluates the model over a dense criterion grid rather than the
    observed rating boundaries.

    Returns
    -------
    tuple[np.ndarray, np.ndarray]
        `(noise, signal)` cumulative proportions over the dense grid.
    """
    return self.compute_expected(smooth=True)

DualProcess

DualProcess(data: ROCData)

Bases: ContinuousModel

Dual-process signal detection model1.

Combines continuous Gaussian discrimination with a high-threshold recollection component of probability \(R\):

\[ H_k = R + (1 - R) \cdot \Phi\left(\frac{d'}{2} - c_k\right), \quad F_k = \Phi\left(-\frac{d'}{2} - c_k\right) \]

where \(\Phi\) is the standard normal CDF and \(c_k\) are the criterion locations .

ATTRIBUTE DESCRIPTION
d

Continuous sensitivity \(d'\).

TYPE: float

R

Recollection probability, \(0 \leq R \leq 1\).

TYPE: float

criteria

Criterion locations \(c_k\), one per rating boundary.

TYPE: ndarray

Source code in src/kriterion/models.py
def __init__(self, data: ROCData) -> None:
    super().__init__(data)
    self.d = 1.0
    self.R = 0.9

roc

roc() -> tuple[ndarray, ndarray]

Smooth ROC curve for plotting.

Evaluates the model over a dense criterion grid rather than the observed rating boundaries.

RETURNS DESCRIPTION
tuple[ndarray, ndarray]

(noise, signal) cumulative proportions over the dense grid.

Source code in src/kriterion/models.py
def roc(self) -> tuple[np.ndarray, np.ndarray]:
    """Smooth ROC curve for plotting.

    Evaluates the model over a dense criterion grid rather than the
    observed rating boundaries.

    Returns
    -------
    tuple[np.ndarray, np.ndarray]
        `(noise, signal)` cumulative proportions over the dense grid.
    """
    return self.compute_expected(smooth=True)