Skip to contents

Apply the ETM door function to code-pair co-occurrence rows

Usage

door(
  data,
  method = "Lookback",
  unit_col,
  time_col,
  post_norm = c("none", "l2"),
  lookback_size = 100L,
  aggregate = c("sum", "mean"),
  weighting = c("equal", "linear"),
  segment_col = NULL,
  alpha = 0.3,
  loess_span = 0.3,
  loess_degree = 1L,
  loess_family = c("gaussian", "symmetric"),
  verbose = FALSE
)

Arguments

data

Data frame from accum$model$row.connection.counts. If only QEUNIT is present (TMA default), it is copied to ENA_UNIT for alignment with replace_door().

method

One or more of "Lookback", "EMA", "LOESS".

unit_col

Column grouping the trajectory (e.g. "UserName").

time_col

Strictly increasing time column within each unit (e.g. "Index").

post_norm

"none" or "l2" row normalization on door_* columns after pooling.

lookback_size

Lookback only — max rows in the backward pool. A single integer applies to all units; a named vector or data.frame (unit + lookback) sets per-unit lookback sizes.

aggregate

Lookback only — "sum" or "mean".

weighting

Lookback only — "equal" or "linear" ramp.

segment_col

Lookback only — if set, the pool resets at each new segment level.

alpha

EMA only — blend weight on the current row (0–1).

loess_span, loess_degree, loess_family

LOESS only — passed to stats::loess.

verbose

Print method settings.

Value

A data frame when length(method) == 1; otherwise a named list of data frames.