run_stationarity_tests_cat: Run all stationarity-related tests for categorical AD

View source: R/lrt_stationarity_cat.R

run_stationarity_tests_catR Documentation

Run all stationarity-related tests for categorical AD

Description

Performs tests for time-invariance and stationarity constraints. For order = 1, the stationarity test corresponds to strict stationarity; for order > 1, it tests marginal-constancy plus time-invariant transitions. Currently supports complete data only.

Usage

run_stationarity_tests_cat(
  y,
  order = 1,
  blocks = NULL,
  homogeneous = TRUE,
  n_categories = NULL,
  test = c("lrt", "score", "mlrt")
)

Arguments

y

Integer matrix with n_subjects rows and n_time columns. Each entry should be a category code from 1 to c.

order

Antedependence order p. Default is 1.

blocks

Optional integer vector of length n_subjects specifying group membership.

homogeneous

Logical. If TRUE (default), parameters are shared across all groups.

n_categories

Number of categories. If NULL, inferred from data.

test

Type of test statistic. One of "lrt" (default), "score", or "mlrt".

Value

A list containing:

time_invariance

Result of test_timeinvariance_cat

stationarity

Result of test_stationarity_cat

table

Summary data frame

Examples


y <- simulate_cat(200, 6, order = 1, n_categories = 2)
result <- run_stationarity_tests_cat(y, order = 1)
print(result$table)



antedep documentation built on April 25, 2026, 1:06 a.m.