time_trend – Deterministic linear time trend (t = 1, 2, ...).#
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.time_trend_transform.
Function signature#
mf.functions.time_trend_transform(
panel: pd.DataFrame,
) -> 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. |
Returns#
pd.DataFrame — scalar result.
Behavior#
Adds a column time_trend to the panel; with params.degree > 1 appends polynomial trends. Deterministic complement to stochastic detrending (HP / Hamilton).
When to use
Trend-stationary linear models where a deterministic trend is part of the DGP.
When NOT to use
Series with structural breaks – use regime_indicator or stochastic detrending instead.
In recipe context#
Set params.op = "time_trend" in the relevant layer to activate this op within a recipe:
# Layer L3 recipe fragment
params:
op: time_trend
References#
macroforecast design Part 2, L3: ‘feature engineering is a DAG of typed transforms; cascade-depth bounds the longest chain at cascade_max_depth.’