Skip to contents

This function iterates through a range of window sizes to find the optimal size for a discourse accumulation. It identifies the "stability plateau" by calculating the correlation between adjacent window sizes and selecting the smallest size that meets a specified threshold of the maximum observed stability.

Usage

ena.tune.window.size(accum_object, min_size = 1, max_size = 20, cutoff = 0.95)

Arguments

accum_object

An ENAAccumulation object or a call that can be re-evaluated to create one.

min_size

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

max_size

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

cutoff

Numeric. The threshold (default 0.95) of the maximum correlation used to determine the "best" window size.

Value

A new ENAAccumulation object generated with the best_window_size.

Details

The function uses the internal _function.call from the accum_object to iteratively rebuild the accumulation. For each window size, it generates an ENA set and extracts the unit points and compute the correlations between ENA points with adjacent window sizes. The best window size is the lowest with correlation higher than cutoff*max_correlation

Examples

if (FALSE) { # \dontrun{
# Assuming 'accum' is your existing accumulation object
tuned_accum <- tune_window_size(accum, min_size = 1, max_size = 20, cutoff = 0.95)
} # }