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_origandub_origdefine a set of strict lower and upper bounds for each parameter, given in the original space. Each parameter is bounded on both sides or on neither. By default None.- ub_orignp.ndarray, optional
The upper bounds of the space.
lb_origandub_origdefine a set of strict lower and upper bounds for each parameter, given in the original space. Each parameter is bounded on both sides or on neither. By default None.- plb_orignp.ndarray, optional
The plausible lower bounds such that
lb_orig <= plb_orig < pub_orig <= ub_orig.plb_origandpub_origrepresent a “plausible” range for each parameter, given in the original space. By default None, which takes the hard bounds.- pub_orignp.ndarray, optional
The plausible upper bounds such that
lb_orig <= plb_orig < pub_orig <= ub_orig.plb_origandpub_origrepresent a “plausible” range for each parameter, given in the original space. By default None, which takes the hard bounds.- scalenp.ndarray, optional
Per-coordinate scale applied after transforming and rotating the parameters, of shape
(D,)and finite and positive throughout. By default None.- rotation_matrixnp.ndarray, optional
A finite orthogonal matrix of shape
(D, D)applied after the coordinate-wise transformation. Reflections are accepted. By default None.- 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
xinto 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
uinto variablesxin 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]#
The log absolute determinant of the Jacobian of the inverse transform at
u, \(\log |\det J_{g^{-1}}(u)|\), where \(g\) maps the original space to the transformed space.- 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.