wavelet – Discrete wavelet transform – multi-scale time-frequency features.#
Back to op axis | Back to L3 | Browse all options
Operational op under axis
op, sub-layerL3_A_step_op, layerl3. Standalone callable:mf.functions.wavelet_transform.
Function signature#
mf.functions.wavelet_transform(
panel: pd.DataFrame,
wavelet: str,
n_levels: int,
) -> pd.DataFrame
Parameters#
name |
type |
default |
constraint |
description |
|---|---|---|---|---|
|
|
— |
— |
Input panel. Each column is a variable; rows are time periods. Series is promoted to a single-column DataFrame internally. |
|
|
|
— |
Wavelet family name (e.g., “db4”, “haar”). Accepted for API consistency; runtime uses a rolling-mean low-pass approximation. |
|
|
|
>= 1 |
Number of decomposition levels. Each level produces an approximation (_wA{level}) and detail (_wD{level}) pair. |
Returns#
pd.DataFrame — scalar result.
Behavior#
Decomposes the series into wavelet detail and approximation coefficients at several scales (params.wavelet, params.level). Captures localised time-frequency patterns that Fourier basis cannot.
When to use
Series with localised oscillations or non-stationary cycles (financial / climate macro).
When NOT to use
Smooth seasonal patterns – use fourier instead.
In recipe context#
Set params.op = "wavelet" in the relevant layer to activate this op within a recipe:
# Layer L3 recipe fragment
params:
op: wavelet
References#
macroforecast design Part 2, L3: ‘feature engineering is a DAG of typed transforms; cascade-depth bounds the longest chain at cascade_max_depth.’