base_transformation#

Classes#

Transformation

Abstract base class for transformations between two parameter spaces: the model

Module Contents#

class base_transformation.Transformation[source]#

Bases: abc.ABC

Abstract 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

abstract _transform(x: numpy.ndarray, method: str) numpy.ndarray[source]#

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[source]#

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[source]#

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.

abstract is_elementwise() bool[source]#

Returns True if the transformation is element-wise, meaning it can be applied element-by-element independently.

abstract jacobian(q: numpy.ndarray) numpy.ndarray[source]#

Returns the Jacobian matrix of the transformation at the parameter vector q.

abstract jacobian_S1(q: numpy.ndarray) tuple[numpy.ndarray, collections.abc.Sequence[numpy.ndarray]][source]#

Computes the Jacobian matrix and its partial derivatives at the parameter vector q.

Returns a tuple (jacobian, hessian).

abstract log_jacobian_det(q: numpy.ndarray) float[source]#

Returns the logarithm of the absolute value of the determinant of the Jacobian matrix at the parameter vector q.

abstract log_jacobian_det_S1(q: numpy.ndarray) tuple[float, numpy.ndarray][source]#

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[source]#

Transforms a parameter vector q from the search space to the model space.

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[source]#

Set and validate the transformation parameter.

property n_parameters[source]#