Skip to content

Interfaces

This section lists the most important interfaces used in the package.

bmi.interface.IMutualInformationPointEstimator

Bases: Protocol

Interface for the mutual information estimator returning point estimates. All estimators should be implementations of this interface.

estimate(x, y) abstractmethod

A point estimate of MI(X; Y) from an i.i.d. sample from the \(P(X, Y)\) distribution.

Parameters:

Name Type Description Default
x ArrayLike

shape (n_samples, dim_x)

required
y ArrayLike

shape (n_samples, dim_y)

required

Returns:

Type Description
float

mutual information estimate

estimate_with_info(x, y)

Allows for reporting additional information about the run.

parameters() abstractmethod

Returns the parameters of the estimator.

bmi.interface.ISampler

Bases: Protocol

Interface for a distribution \(P(X, Y)\).

dim_total: int property

Dimension of the space in which the (X, Y) variable is valued. Should be equal to the sum of dim_x and dim_y.

dim_x: int abstractmethod property

Dimension of the space in which the X variable is valued.

dim_y: int abstractmethod property

Dimension of the space in which the Y variable is valued.

mutual_information() abstractmethod

Mutual information MI(X; Y).

sample(n_points, rng) abstractmethod

Returns a sample from the joint distribution P(X, Y).

Parameters:

Name Type Description Default
n_points int

sample size

required
rng Union[int, KeyArray]

pseudorandom number generator

required

Returns:

Type Description
ndarray

X samples, shape (n_points, dim_x)

ndarray

Y samples, shape (n_points, dim_y). Note that these samples are paired with X samples.