Skip to contents

select_joint_distribution() screens marginal distribution and copula combinations by fitting intercept-only gamlss_longitudinal() models and ranking their joint likelihood, AIC, or BIC. Unlike select_margin() and select_copula(), this selector evaluates each candidate as a full joint longitudinal model, so it can take substantially longer on large candidate sets.

Usage

select_joint_distribution(
  data,
  response_var,
  time_var = "time",
  subject_var = "subject",
  type = NULL,
  margin_families = NULL,
  copula_families = c("N", "C", "F", "G", "J", "t"),
  criterion = c("AIC", "BIC", "logLik"),
  min_pairs = 10,
  time_intercepts = FALSE,
  copula_time_intercepts = FALSE,
  try.gamlss = FALSE,
  trace = FALSE,
  progress = TRUE,
  fit_args = list(),
  keep_fits = FALSE
)

Arguments

data

Long-format data frame.

response_var

Response column name in data.

time_var, subject_var

Time and subject identifier column names.

type

Optional gamlss::fitDist() type passed to select_margin().

margin_families

Optional marginal family names. When supplied, these are used directly as the marginal candidate set; otherwise candidates come from select_margin().

copula_families

Candidate copula family codes. Supported values are "N", "C", "F", "G", "J", and "t".

criterion

Ranking criterion, one of "AIC", "BIC", or "logLik".

min_pairs

Minimum number of complete adjacent response pairs required before fitting candidates.

time_intercepts

Logical; if TRUE, pass through to select_margin() and use time-specific intercepts for each marginal distribution parameter in the joint screening fits.

copula_time_intercepts

Logical; if TRUE, use time-specific intercepts for the copula dependence parameter in the joint screening fits. Time is treated as a factor, not as a linear trend.

try.gamlss

Passed to select_margin().

trace

Logical; passed to select_margin() and used to decide whether candidate gamlss_longitudinal() fit output is shown.

progress

Logical; if TRUE, print candidate-level progress messages with elapsed time and an estimated remaining runtime.

fit_args

Optional named list of arguments overriding the default gamlss_longitudinal() screening fit settings.

keep_fits

Logical; if TRUE, attach successful fitted models in the "fits" attribute.

Value

A data frame with one row per margin-copula combination and class joint_distribution_selection. Failed fits are retained with an error message and missing fit metrics.