lrt.A: likelihood ratio test for two models based on kstest.A

lrt.AR Documentation

likelihood ratio test for two models based on kstest.A

Description

Conduct likelihood ratio test for comparing two different models.

Usage

lrt.A(d1, d2, parallel = FALSE)

Arguments

d1

An object of class 'kstest.A'.

d2

An object of class 'kstest.A'.

parallel

Whether to use multiple threads to paralleling computation. Default is FALSE. Please aware that it may take longer time to execute the program with parallel=FALSE.

Details

If the pvalue of d1 and d2 are greater than the user-specified significance level, which indicates that the original data x may come from the two distributions in d1 and d2, a likelihood ratio test is desired to choose a more 'possible' distribution based on the current data. NOTE that the x in d1 and d2 must be IDENTICAL! Besides, NOTE that the dist in d1 and d2 must be DIFFERENT! The dist inherited from d1 is the null distribution and that from d2 is used as the alternative distribution.

If the output p-value smaller than the user-specified significance level, the dist of d2 is more appropriate for modeling x. Otherwise, There is no significant difference between dist of d1 and dist of d2, given the current data.

Value

The p-value of the likelihood ratio test.

Examples

set.seed(1005)
x=sample.h1(2000,phi=0.3,dist='poisson',lambda=10)
d1=kstest.A(x,nsim=100,bootstrap = TRUE,dist= 'ph',lowerbound = 1e-10, upperbound = 100000)
d2=kstest.A(x,nsim=100,bootstrap = TRUE,dist= 'geomh',lowerbound = 1e-10, upperbound = 100000)
lrt.A(d1,d2, parallel = FALSE) #0.28

AZIAD documentation built on Aug. 14, 2022, 9:05 a.m.

Related to lrt.A in AZIAD...