Skip to contents

Runs a standard set of stationarity constraints for Gaussian AD models.

Usage

run_stationarity_tests_gau(
  y,
  order = 1L,
  blocks = NULL,
  verbose = FALSE,
  max_iter = 2000L,
  rel_tol = 1e-08,
  ...
)

Arguments

y

Numeric matrix with n_subjects rows and n_time columns.

order

Antedependence order (0, 1, or 2).

blocks

Optional vector of block memberships (length n_subjects).

verbose

Logical; if TRUE, prints progress.

max_iter

Maximum number of optimization iterations for constrained fits.

rel_tol

Relative tolerance for constrained optimization.

...

Additional arguments passed to fit_gau for the unconstrained fit.

Value

A list with class "stationarity_tests_gau" containing:

fit_unconstrained

Unconstrained Gaussian AD fit

tests

Named list of test_stationarity_gau results

summary

Summary table of all constraints

Examples

set.seed(1)
y <- simulate_gau(n_subjects = 80, n_time = 6, order = 1, phi = 0.4, sigma = 1)
out <- run_stationarity_tests_gau(y, order = 1, verbose = FALSE)
out$summary
#>       constraint method df       LRT   p_value BIC_selected
#> phi          phi    lrt  4  5.063212 0.2808729  constrained
#> sigma      sigma    lrt  5  5.305121 0.3797883  constrained
#> both        both    lrt  9 10.202930 0.3343081  constrained