Transforms
This package comes with two built-in coordinate transformations, Multply and PowerLawAge.
Users can define custom coordinate transformations by following the structure of these class definitions.
Multiply
- class mastercurves.transforms.multiply.Multiply(bounds=(0.01, 1), scale='log', prior='uniform')
Class definition for a multiplicative shift.
- Attributes:
bounds(tuple[float]): the bounds for the shift factordefault(float): default value of the shift factor (1)prior(p, lam -> float): the prior distribution over the shift factor. Either Gaussian or uniform.scale(string): coordinate scale, either log or linearshared(bool):False, since the shift factors are not shared between statestype(string):Multiply
- __init__(bounds=(0.01, 1), scale='log', prior='uniform')
Initialize the Multiply object.
- Args:
bounds(tuple[float]): the upper and lower bounds for the shift factors. Defaults to (1E-2,1).scale(string): either “log” for a shift in the logarithm of a variable or “linear” for the shift in the variable. Defaults to “log”.prior(string): either “uniform” for a uniform prior over the shift factors or “Gaussian” for a Gaussian prior. Defaults to “uniform”.
- backward(param, state, data)
Run a forward shift on the data (from the reference state to the current state).
- Args:
param(float): value of the shift factor for this statestate(float): value of the state parameter for this data setdata(array_like): coordinates to be shifted- Returns:
transformed(array_like): the transformed coordinates
- forward(param, state, data)
Run a forward shift on the data (from the current state to the reference state).
- Args:
param(float): value of the shift factor for this statestate(float): value of the state parameter for this data setdata(array_like): coordinates to be shifted- Returns:
transformed(array_like): the transformed coordinates
PowerLawAge
- class mastercurves.transforms.powerlawage.PowerLawAge(tref, scale='log')
Class definition for a power law aging shift.
- Attributes:
bounds(tuple[float]): the bounds for the aging exponentdefault(float): default value for the aging exponent (1.1)param(string): name of the aging exponent (“mu”)prior(p, lam -> float): the prior distribution over the aging exponent. Only a uniform prior currently supported.scale(string): coordinate scale, either log or linearshared(bool): attr:True, since the aging exponent is state-independenttref(float): the reference timetype(string):PowerLawAge
- __init__(tref, scale='log')
Initialize the PowerLawAge object.
- Args:
tref(float): the reference timescale(string): the scale of the time axis (“log” or “linear”). Defaults to “log”
- backward(param, state, data)
Run a backward shift of the data (from effective time to real time).
- Args:
param(float): value of the aging exponent “mu”state(float): value of the state parameter (the wait time)data(:attr:’array_like`): the effective coordinate (either xi or log(xi))- Returns:
transformed(array_like): the transformed real time coordinate (either t or log(t))
- forward(param, state, data)
Run a forward shift of the data (from real time to effective time).
- Args:
param(float): value of the aging exponent “mu”state(float): value of the state parameter (the wait time)data(:attr:’array_like`): the time coordinate (either t or log(t))- Returns:
transformed(array_like): the transformed effective time coordinate (either xi or log(xi))