lr.test: Perform likelihood ratio test between two ghype models.

Description Usage Arguments Value Examples

View source: R/tests.R

Description

lr.test allows to test between two nested ghype models whether there is enough evidence for the alternative (more complex) model compared to the null model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
lr.test(
  nullmodel,
  altmodel,
  df = NULL,
  Beta = TRUE,
  seed = NULL,
  nempirical = NULL,
  parallel = FALSE,
  returnBeta = FALSE,
  method = NULL
)

Arguments

nullmodel

ghype object. The null model

altmodel

ghype object. The alternative model

df

optional scalar. the number of degrees of freedom.

Beta

boolean, whether to use empirical Beta distribution approximation. Default TRUE

seed

scalar, seed for the empirical distribution.

nempirical

optional scalar, number of replicates for empirical beta distribution.

parallel

optional, number of cores to use or boolean for parallel computation. If passed TRUE uses all cores-1, else uses the number of cores passed. If none passed performed not in parallel.

returnBeta

boolean, return estimated parameters of Beta distribution? Default FALSE.

method

string, for internal use

Value

p-value of test. If returnBeta=TRUE returns the p-value together with the parameters of the beta distribution.

Examples

1
2
3
4
data("adj_karate")
regularmodel <- regularm(graph = adj_karate, directed = FALSE, selfloops = FALSE)
confmodel <- scm(graph = adj_karate, directed = FALSE, selfloops = FALSE)
lr.test(nullmodel = regularmodel, altmodel = confmodel, seed = 123)

ghypernet documentation built on Oct. 15, 2021, 5:14 p.m.