prophys.transformations

prophys.transformations#

Deterministic transformations: linear, polynomial, piecewise, decay, dose response, tables and periodic signals.

A Transform maps an expression to an expression and composes with Transform.then(). Bijective transforms also serve as bijectors of a TransformedDistribution.

Classes

Transform

Base class of deterministic transformations that map expressions to expressions.

FunctionTransform

Wrap a plain Expr -> Expr callable as a transform that is not bijective.

Linear

Elementwise linear map y = a * x + b, bijective for a != 0.

Affine

Affine map y = A @ x + b of a vector x, bijective for invertible A.

Polynomial

Elementwise polynomial y = sum_i coeffs[i] * x**i, lowest order first.

PiecewiseLinear

Piecewise linear curve through (knots[i], values[i]).

Decay

Exponential or power law decay with distance, typically composed after a distance primitive.

Logistic

Logistic dose response curve L / (1 + exp(-k * (x - x0))).

TableLookup1D

Linearly interpolated 1D lookup table, e.g. a wind turbine power curve.

TableLookup2D

Bilinearly interpolated 2D lookup table, e.g. sound power level over (wind speed, direction).

Phase

Wrap a continuous variable into [0, period), e.g. hours since start into hour of day.

Periodic

Learnable finite Fourier series for seasonal, diurnal or tidal signals.

ReturnPeriod

Convert an annual exceedance probability to a return period 1 / p and back.

RecurrenceRate

Convert a mean time between events to an event rate 1 / interval and back.