Skip to contents

Calculates the recommended moving window size for Epistemic Network Analysis (ENA) by estimating the half-life decay lag of the noise-corrected Frobenius norm across pooled conversation cross-covariance matrices.

Usage

ena.ccd.window(
  x,
  codeNames = NULL,
  conversation_cols = NULL,
  max_window = 20,
  min_overlap = 10
)

Arguments

x

A data.frame, data.table, or an ENAdata/ena.set accumulation object.

codeNames

A character vector of column names representing binary codes (optional if x is an ENA object).

conversation_cols

A character vector of column names defining discrete conversations (optional if x is an ENA object).

max_window

A numeric value indicating the maximum lag window size to evaluate. Default is 20.

min_overlap

A numeric value specifying the minimum required overlapping rows (\(N - lag\)) per conversation subset. Default is 10.

Value

An integer scalar representing the estimated half-life lag window size.

Details

The function computes pooled cross-covariance curves over lags 0:max_window. It normalizes the noise-corrected Frobenius norm relative to its peak value and identifies the first lag step strictly after the peak where the normalized norm falls below 0.5 (half-life threshold).

References

Shaffer, D. W. & Cai, Z. (2026). Discourse Coherence Length: Noise-Corrected Covariance Estimation of Window-Size in Epistemic Network Analysis. International Conference on Quantitative Ethnography (ICQE26).

Examples

data(RS.data)
codeNames <- c("Data", "Technical.Constraints", "Performance.Parameters",
               "Client.and.Consultant.Requests", "Design.Reasoning", "Collaboration")
w <- ena.ccd.window(RS.data, codeNames = codeNames,
                    conversation_cols = c("Condition", "GroupName"))
print(w)
#> [1] 6