| bic_order_cat | R Documentation |
Fits AD models of increasing orders and selects the best by BIC.
bic_order_cat(
y,
max_order = 2,
blocks = NULL,
homogeneous = TRUE,
n_categories = NULL,
criterion = "bic"
)
y |
Integer matrix of categorical data (n_subjects x n_time). |
max_order |
Maximum order to consider. Default is 2. |
blocks |
Optional block membership vector. |
homogeneous |
Whether to use homogeneous parameters across blocks. |
n_categories |
Number of categories (inferred if NULL). |
criterion |
Which criterion to use: "bic" (default) or "aic". |
A list containing:
table |
Data frame with order, log_l, n_params, aic, bic |
bic |
Named numeric vector of BIC values by order |
best_order |
Order with lowest criterion value |
criterion |
Criterion used for order selection ( |
fits |
List of fitted models |
y <- simulate_cat(100, 5, order = 1, n_categories = 2)
result <- bic_order_cat(y, max_order = 2)
print(result$table)
print(result$best_order)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.