estimate_bhatt: Estimate Bhattacharyya distance, globally or by group

View source: R/pillai_bhatt.R

estimate_bhattR Documentation

Estimate Bhattacharyya distance, globally or by group

Description

Unified front-end for Bhattacharyya distance (and affinity) under a multivariate normal approximation.

Usage

estimate_bhatt(
  data,
  features,
  category_col,
  group_col = NULL,
  min_tokens = 20,
  eps = 1e-06
)

Arguments

data

Data frame.

features

Character vector of numeric feature columns.

category_col

String; category column name (exactly two levels globally).

group_col

Optional character vector of one or more grouping columns. If NULL, a single global Bhattacharyya distance is returned.

min_tokens

Minimum tokens (globally or per group).

eps

Small ridge constant passed to bhattacharyya_mvnorm().

Value

Data frame with either one global row or one row per group.


phontrast documentation built on Oct. 7, 2026, 5:06 p.m.