Skip to content

Commit

Permalink
Add custom discrete diagonal
Browse files Browse the repository at this point in the history
  • Loading branch information
edeno committed Aug 1, 2023
1 parent 0a8814d commit 9ad6988
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/non_local_detector/discrete_state_transitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,38 @@ def make_state_transition(self, *args, **kwargs) -> tuple[np.ndarray, None, None
return make_transition_from_diag(diag), None, None


@dataclass
class DiscreteStationaryCustom:
"""Creates a custom discrete transition matrix.
Attributes
----------
values : np.ndarray, shape (n_states, n_states)
The values of the transition matrix.
"""

values: np.ndarray

def make_state_transition(self, *args, **kwargs) -> tuple[np.ndarray, None, None]:
"""Constructs the initial discrete transition matrix.
Returns
-------
discrete_transition : np.ndarray, shape (n_states, n_states)
The initial discrete transition matrix.
discrete_transition_coefficients : None
The coefficients for the non-stationary transition matrix.
It is None here because the transition matrix is stationary.
discrete_transition_design_matrix : None
The design matrix for the non-stationary transition matrix.
It is None here because the transition matrix is stationary.
"""
return np.asarray(self.values), None, None


@dataclass
class DiscreteNonStationaryDiagonal:
"""Covariate driven transition matrix that changes over time.
Expand Down

0 comments on commit 9ad6988

Please sign in to comment.