leaspy.models.riemanian_manifold

Classes

RiemanianManifoldModel

Manifold model for multiple variables of interest (logistic or linear formulation).

LinearInitializationMixin

Compute initial values for model parameters.

LinearModel

Manifold model for multiple variables of interest (linear formulation).

LogisticInitializationMixin

LogisticModel

Manifold model for multiple variables of interest (logistic formulation).

Module Contents

class RiemanianManifoldModel(name, variables_to_track=None, **kwargs)

Bases: leaspy.models.time_reparametrized.TimeReparametrizedModel

Manifold model for multiple variables of interest (logistic or linear formulation).

Parameters:
namestr

The name of the model.

**kwargs

Hyperparameters of the model (including noise_model)

Raises:
LeaspyModelInputError
  • If hyperparameters are inconsistent

Parameters:
  • name (str)

  • variables_to_track (Optional[Iterable[leaspy.variables.specs.VariableName]])

classmethod compute_sufficient_statistics(state)

Compute the model’s sufficient statistics.

Parameters:
stateState

The state to pick values from.

Returns:
SuffStatsRW

The computed sufficient statistics.

Parameters:

state (State)

Return type:

leaspy.variables.specs.SuffStatsRW

get_variables_specs()

Return the specifications of the variables (latent variables, derived variables, model ‘parameters’) that are part of the model.

Returns:
NamedVariables

The specifications of the model’s variables.

Return type:

NamedVariables

static metric(*, g)
Abstractmethod:

Parameters:

g (Tensor)

Return type:

Tensor

classmethod model_no_sources(*, rt, metric, v0, g)

Returns a model without source. A bit dirty?

Parameters:

rt (Tensor)

Return type:

Tensor

classmethod model_with_sources(*, rt, space_shifts, metric, v0, g)
Abstractmethod:

Parameters:
Return type:

Tensor

class LinearInitializationMixin

Compute initial values for model parameters.

class LinearModel(name, **kwargs)

Bases: LinearInitializationMixin, RiemanianManifoldModel

Manifold model for multiple variables of interest (linear formulation).

Parameters:

name (str)

get_variables_specs()

Return the specifications of the variables (latent variables, derived variables, model ‘parameters’) that are part of the model.

Returns:
NamedVariables

The specifications of the model’s variables.

Return type:

NamedVariables

static metric(*, g)

Used to define the corresponding variable.

Parameters:

g (Tensor)

Return type:

Tensor

classmethod model_with_sources(*, rt, space_shifts, metric, v0, g)

Returns a model with sources.

Parameters:
Return type:

Tensor

class LogisticInitializationMixin
class LogisticModel(name, **kwargs)

Bases: LogisticInitializationMixin, RiemanianManifoldModel

Manifold model for multiple variables of interest (logistic formulation).

Parameters:

name (str)

get_variables_specs()

Return the specifications of the variables (latent variables, derived variables, model ‘parameters’) that are part of the model.

Returns:
NamedVariables

The specifications of the model’s variables.

Return type:

NamedVariables

static metric(*, g)

Used to define the corresponding variable.

Parameters:

g (Tensor)

Return type:

Tensor

classmethod model_with_sources(*, rt, space_shifts, metric, v0, g)

Returns a model with sources.

Parameters:
  • rt (leaspy.utils.weighted_tensor.TensorOrWeightedTensor[float])

  • space_shifts (leaspy.utils.weighted_tensor.TensorOrWeightedTensor[float])

  • metric (leaspy.utils.weighted_tensor.TensorOrWeightedTensor[float])

  • v0 (leaspy.utils.weighted_tensor.TensorOrWeightedTensor[float])

  • g (leaspy.utils.weighted_tensor.TensorOrWeightedTensor[float])

Return type:

Tensor