Skip to content

Log Difference Transform

log_diff_step(
    name: str,
    **kwargs: Any,
) -> MCStep

log_diff_step applies first differences to the logged input:

np.diff(np.log(x + offset), axis=0)

The output has one fewer row than the selected input.

Key Parameters:

Name Default Description
source required Input source channel.
filter_key "filter" Filter result key when reading filter output.
payload_key None Producer payload key when source="payload".
columns None Optional column subset.
burn_in 0 Rows dropped before transformation.
drop_initial False Drop the initial state row for state inputs.
offset 0.0 Constant added before taking logs.

The output is stored in the step payload and can be consumed downstream with source="payload".