compute_information_criteria: Compute information criteria

Description Usage Arguments Details Value Examples

View source: R/compute_information_criteria.R

Description

Function compute_infromation_criteria provides mAIC, cAIC and mBIC for NERM

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
compute_information_criteria(
  X,
  y,
  clusterID,
  model,
  sig_u,
  sig_e,
  fit_model_fixed,
  fit_model_mixed
)

Arguments

X

Matrix with covariates for fixed effects

y

Vector of responses

clusterID

Vector with cluster labels

model

Type of mixed model: NERM, FHM, RIRS (random slopes and random intercepts)

sig_u

Variance parameter of random effects

sig_e

Variance parameter of errors

fit_model_fixed

Estimated model using fixed effects

fit_model_mixed

Estimated model using fixed and random effects

Details

Penalty term in cAIC depends on the model selected. Function compute_information_criteria is simplified because for now only NERM is supported.

Value

List with information criteria:

mAIC

Marginal AIC

mBIC

Marginal BIC

cAIC

Conditional AIC

deg_cAIC

Penalty of conditional AIC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
n = 10
m_i = 5
m_total = 50

clusterID = rep(1:n, m_i)
p = 10
beta = rep(2, p)
u_i = rnorm(n, 0, 2)
u_i_aug = rep(u_i, each = m_i)
X = matrix(rnorm(m_total * p), m_total, p)
y = X%*%beta + u_i_aug + rnorm(m_total, 0, 1)
fit <- estimate_NERM(X, y, clusterID)

IC <- compute_information_criteria(X = X, y = y,
                                   clusterID = clusterID,
                                   model = "NERM",
                                   sig_u = fit$sig_u,
                                   sig_e = fit$sig_e,
                                   fit_model_fixed = fit$fit_model_fixed,
                                   fit_model_mixed = fit$fit_model_mixed)

KatarzynaReluga/postcAIC documentation built on Jan. 25, 2022, 12:33 a.m.