| jsd_summary | R Documentation |
Convenience wrapper that returns both the point-estimate JSD and, optionally, bootstrap-based uncertainty (mean, SD, and CI) for each group.
jsd_summary(
data,
group_col,
category_col,
features,
do_boot = TRUE,
n_boot = 1000,
min_tokens = 20,
conf_level = 0.95,
bw = c("Hpi", "Hscv", "Hpi.diag", "scott.diag"),
eval_on = c("pooled", "group1", "group2", "pooled_sample"),
eval_n = NULL,
eval_seed = NULL,
engine = c("ks", "fast_diag", "fast_diagonal"),
chunk_size = 1000L,
method = c("mc", "legacy"),
density = c("kde", "mvnorm"),
mc_n = 10000L,
...
)
data |
Data frame containing acoustic measurements. |
group_col |
Character vector giving one or more grouping columns
(e.g., |
category_col |
String: name of column giving the category to compare (e.g., "vowel"). Each group must have exactly two categories. |
features |
Character vector of column names giving the acoustic space. |
do_boot |
Logical; if TRUE (default), perform bootstrap via |
n_boot |
Integer; number of bootstrap resamples per group if
|
min_tokens |
Minimum number of tokens per group required to compute JSD. Groups with fewer tokens are dropped. |
conf_level |
Confidence level for bootstrap intervals. |
bw |
Bandwidth selection method passed to |
eval_on |
KDE evaluation points passed to |
eval_n |
Optional maximum number of KDE evaluation points. |
eval_seed |
Optional integer seed for KDE evaluation-point subsampling. |
engine |
KDE evaluation engine passed to |
chunk_size |
Chunk size for |
method |
Estimator passed to |
density |
Density model passed to |
mc_n |
Positive integer; number of Monte-Carlo samples drawn from each
fitted Gaussian when |
... |
Additional arguments passed to |
A tibble with one row per group and columns:
group - group ID (e.g., speaker)
n_tokens - number of tokens for that group
jsd_point - single JSD point estimate
n_boot, conf_level, jsd_mean,
jsd_sd, ci_lower, ci_upper,
jsd_low, jsd_high - bootstrap summary columns.
These are NA (or 0 for n_boot) if
do_boot = FALSE.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.