leaspy.models.linear

Classes

LinearInitializationMixin

Compute initial values for model parameters.

LinearModel

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

Module Contents

class LinearInitializationMixin[source]

Compute initial values for model parameters.

class LinearModel(name, **kwargs)[source]

Bases: LinearInitializationMixin, leaspy.models.riemanian_manifold.RiemanianManifoldModel

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

Parameters:

name (str)

get_variables_specs()[source]

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

Returns:
:class:`~leaspy.variables.specs.NamedVariables

A dictionary-like object mapping variable names to their specifications.

Return type:

NamedVariables

static metric(*, g)[source]

Compute the metric tensor for the model.

Parameters:
gtorch.Tensor

Input tensor with values of the population parameter g for each feature.

Returns:
torch.Tensor

A tensor of ones with the same shape as g.

Parameters:

g (Tensor)

Return type:

Tensor

classmethod model_with_sources(*, rt, space_shifts, metric, v0, g)[source]

Return the model output when sources(spatial components) are present.

Parameters:
rttorch.Tensor

The reparametrized time.

space_shiftstorch.Tensor

The values of the space-shifts

metricAny

The metric tensor used for computing the spatial/temporal influence.

v0Any

The values of the population parameter v0 for each feature.

gAny

The values of the population parameter g for each feature.

Returns:
torch.Tensor

The model output with contribution from sources.

Parameters:
Return type:

Tensor