jmstate.functions.base_hazards.Exponential

class Exponential(lmda, *, frozen=False)[source]

Implements the Exponential base hazard.

Exponential base hazard is time independent.

It is given by the formula:

\[\lambda_0(t) = \lambda.\]
This method expects:
  • t0: a column vector of previous transition times, shape (n, 1).

  • t1: a matrix of future evaluation times, shape (n, m), with the same number of rows as t0.

The output is the log base hazard evaluated at each t1 relative to t0.

Optimization of the parameters can be disabled by checking the forzen flag.

Variables:
  • log_lmda (nn.Parameter | torch.Tensor) – The log rate factor.

  • frozen (bool) – Whether the parameters are frozen.

Parameters:
  • lmda (float)

  • frozen (bool)

__init__(lmda, *, frozen=False)[source]

Initializes the Exponential hazard.

Parameters:
  • lmda (float) – The rate factor.

  • frozen (bool, optional) – Whether to freeze the parameters. Defaults to False.

forward(t0, t1)[source]

Calls the Exponential base hazard.

Parameters:
  • t0 (torch.Tensor) – Previous transition times, shape \((n, 1)\).

  • t1 (torch.Tensor) – Future evaluation times, shape \((n, m)\).

Returns:

The computed base hazard in log scale.

Return type:

torch.Tensor

property lmda: Tensor

Gets the rate factor.

Returns:

The rate factor.

Return type:

torch.Tensor