Skip to contents

Estimates the optimal moving window size for discourse accumulation and returns a new accumulation object constructed with the tuned window size. By default, uses Cross-Covariance Decay (CCD; method = "ccd") to estimate the discourse coherence length. Alternatively, the legacy SVD projection stability heuristic (method = "stability") can be used.

Usage

ena.tune.window.size(
  accum_object,
  min_size = 1,
  max_size = 20,
  method = c("ccd", "stability"),
  cutoff = 0.95,
  min_overlap = 10,
  ...
)

Arguments

accum_object

An ENAAccumulation/ENAdata/ena.set object.

min_size

Integer. The minimum window size (default=1) to test.

max_size

Integer. The maximum window size (default=20) to test.

method

Character. Window estimation method: "ccd" (default, Cross-Covariance Decay) or "stability" (legacy SVD stability plateau).

cutoff

Numeric. The threshold (default 0.95) of the maximum correlation used when method = "stability".

min_overlap

Integer. Minimum required overlapping rows per conversation when method = "ccd" (default=10).

...

Additional arguments passed to the underlying window estimation function.

Value

A new ENAdata/ena.set object accumulated with the best_window_size.

Details

When method = "ccd" (default), the function uses ena.ccd.window to calculate the discourse coherence half-life decay lag directly from the conversation stream.

When method = "stability", the function iteratively rebuilds accumulation objects across candidate window sizes, generates ENA sets, and computes distance-space correlations between adjacent window sizes until reaching cutoff * max_correlation.

Examples

if (FALSE) { # \dontrun{
data(RS.data)
codeNames <- c("Data", "Technical.Constraints", "Performance.Parameters",
               "Client.and.Consultant.Requests", "Design.Reasoning", "Collaboration")
accum <- ena.accumulate.data(
  units = RS.data[, c("UserName", "Condition")],
  conversation = RS.data[, c("Condition", "GroupName")],
  codes = RS.data[, codeNames],
  window.size.back = 4
)
tuned_accum <- ena.tune.window.size(accum, method = "ccd")
} # }