ParameterTransformer
#
- class pyvbmc.parameter_transformer.ParameterTransformer(D: int, lb_orig: ndarray = None, ub_orig: ndarray = None, plb_orig: ndarray = None, pub_orig: ndarray = None, scale: ndarray = None, rotation_matrix: ndarray = None, transform_type='logit')[source]#
A class used to enable transforming of variables from unconstrained to constrained space and vice versa.
- Parameters:
- Dint
The dimension of the space.
- lb_orignp.ndarray, optional
The lower bounds of the space.
lb_orig
andub_orig
define a set of strict lower and upper bounds for each parameter, given in the original space. By default None.- ub_orignp.ndarray, optional
The upper bounds of the space.
lb_orig
andub_orig
define a set of strict lower and upper bounds for each parameter, given in the original space. By default None.- plb_orignp.ndarray, optional
The plausible lower bounds such that
lb_orig < plb_orig < pub_orig < ub_orig
.plb_orig
andpub_orig
represent a “plausible” range for each parameter, given in the original space. By default None.- pub_orignp.ndarray, optional
The plausible upper bounds such that
lb_orig < plb_orig < pub_orig < ub_orig
.plb_orig
andpub_orig
represent a “plausible” range for each parameter, given in the original space. By default None.- bounded_transform_typestr, optional
A string indicating the type of transform for bounded variables: one of [“logit”, (“norminv” || “probit”), “student4”]. Default “logit”.
- __call__(x: ndarray)[source]#
Performs direct transform of original variables
x
into unconstrained variablesu
.- Parameters:
- xnp.ndarray
A N x D array, where N is the number of input data and D is the number of dimensions
- Returns:
- unp.ndarray
The variables transformed to unconstrained variables.
- inverse(u: ndarray)[source]#
Performs inverse transform of unconstrained variables
u
into variablesx
in the original space- Parameters:
- unp.ndarray
The unconstrained variables that will be transformed.
- Returns:
- xnp.ndarray
The original variables which result of the transformation.
- log_abs_det_jacobian(u: ndarray)[source]#
log_abs_det_jacobian(u)
returns the log absolute value of the determinant of the Jacobian of the parameter transformation evaluated atu
, that is :math: log |D du(g^-1(u))|.- Parameters:
- unp.ndarray
The points where the log determinant of the Jacobian should be evaluated (in transformed space).
- Returns:
- pnp.ndarray
The log absolute determinant of the Jacobian.