base_transformation#
Classes#
Abstract base class for transformations between two parameter spaces: the model |
Module Contents#
- class base_transformation.Transformation#
Bases:
abc.ABCAbstract base class for transformations between two parameter spaces: the model parameter space and a search space.
If transform is an instance of a Transformation class, you can apply the transformation of a parameter vector from the model space p to the search space q using q = transform.to_search(p) and the inverse using p = transform.to_model(q).
Based on pints.transformation method.
References
- abstractmethod _transform(x: numpy.ndarray, method: str) numpy.ndarray#
Transforms a parameter vector x from the search space to the model space if method is “to_model”, or from the model space to the search space if method is “to_search”.
- convert_covariance_matrix(cov: numpy.ndarray, q: numpy.ndarray) numpy.ndarray#
Converts a covariance matrix covariance from the model space to the search space around a parameter vector q in the search space.
- convert_standard_deviation(std: float | numpy.ndarray, q: numpy.ndarray) numpy.ndarray#
Converts standard deviation std, either a scalar or a vector, from the model space to the search space around a parameter vector q in the search space.
- abstractmethod is_elementwise() bool#
Returns True if the transformation is element-wise, meaning it can be applied element-by-element independently.
- abstractmethod jacobian(q: numpy.ndarray) numpy.ndarray#
Returns the Jacobian matrix of the transformation at the parameter vector q.
- abstractmethod jacobian_S1(q: numpy.ndarray) tuple[numpy.ndarray, collections.abc.Sequence[numpy.ndarray]]#
Computes the Jacobian matrix and its partial derivatives at the parameter vector q.
Returns a tuple (jacobian, hessian).
- abstractmethod log_jacobian_det(q: numpy.ndarray) float#
Returns the logarithm of the absolute value of the determinant of the Jacobian matrix at the parameter vector q.
- abstractmethod log_jacobian_det_S1(q: numpy.ndarray) tuple[float, numpy.ndarray]#
Computes the logarithm of the absolute value of the determinant of the Jacobian, and returns it along with its partial derivatives.
- to_model(q: numpy.ndarray) numpy.ndarray#
Transforms a parameter vector q from the search space to the model space.
- to_search(p: numpy.ndarray) numpy.ndarray#
Transforms a parameter vector p from the model space to the search space.
- verify_input(inputs: float | int | list[float] | numpy.ndarray | dict[str, float]) numpy.ndarray#
Set and validate the transformation parameter.
- property n_parameters#