1. CovarianceMatrix#
- class CovarianceMatrix(row_list: list[list], epoch: int, frame: str = 'J2000', from_list: bool = False, corr_factors=None, sequence_added_sigmas=None, definition=None)#
Bases:
object
Represents a covariance matrix.
Provides methods to manipulate and perform operations on covariance matrices.
- Parameters:
row_list (
list[list]
) – A list of lists representing the covariance matrix.epoch (
int
) – The epoch of the covariance matrix.frame (
str
, optional) – The reference frame of the covariance matrix. Defaults to'J2000'
.from_list (
bool
, optional) – Indicates whether the covariance matrix should be constructed from a list. Defaults toFalse
.corr_factors (
list
, optional) – A list of correlation factors for the off-diagonal elements. Defaults toNone
.added_sigmas (
list
, optional) – A list of additional standard deviations for the sequence scenario. Defaults toNone
.definition (
DEPRECATED
, optional) – The sequence or state definition. Defaults toNone
.
Attributes
The sequence or state definition.
The epoch of the covariance matrix.
The reference frame of the covariance matrix.
The covariance matrix represented as a list of lists.
Methods
covariance_matrix_from_list
(sigmas, corr_matrix)Constructs a covariance matrix from a list of ArrayWUnits objects.
Iterates over each element in the covariance matrix and extracts the values without units.
reinitialize_with_matrix
(new_matrix[, ...])Re-initializes the class with a new covariance matrix.
vector_to_correlation_matrix
(diag_cov, ...)Converts a vector of correlation factors and a vector of diagonal covariance values into a correlation matrix.
- covariance_matrix_from_list(sigmas: list[ArrayWUnits], corr_matrix: float) None #
Constructs a covariance matrix from a list of ArrayWUnits objects.
- matrix_without_units()#
Iterates over each element in the covariance matrix and extracts the values without units. The resulting matrix is then converted into a numpy array.
- Returns:
no_units – The covariance matrix without units.
- Return type:
- reinitialize_with_matrix(new_matrix: ndarray, new_epoch: float = None, new_frame: str = None) Self #
Re-initializes the class with a new covariance matrix.
- Parameters:
new_matrix (
numpy.ndarray
) – The new covariance matrix.new_epoch (
float
, optional) – The new epoch value. Defaults toNone
.new_frame (
str
, optional) – The new frame value. Defaults toNone
.
- Returns:
re_init – The re-initialized covariance matrix object.
- Return type:
- vector_to_correlation_matrix(diag_cov: list, upper_tri_vec: list) ndarray #
Converts a vector of correlation factors and a vector of diagonal covariance values into a correlation matrix.
- Parameters:
diag_cov (
list
) – A list of diagonal covariance values.upper_tri_vec (
list
) – A list of correlation factors for the upper triangular part of the matrix.Returns
corr_mat (
numpy.ndarray
) – The correlation matrix.
- property definition#
The sequence or state definition.
- property matrix: list[list[ArrayWUnits]]#
The covariance matrix represented as a list of lists.