LR_test: Perform likelihood ratio test

Description Usage Arguments Details Value References See Also Examples

View source: R/WaldAndLR.R

Description

LR_test performs a likelihood ratio test for a GMAR, StMAR, or G-StMAR model.

Usage

1
LR_test(gsmar1, gsmar2)

Arguments

gsmar1

an object of class 'gsmar' generated by fitGSMAR or GSMAR, containing the unconstrained model.

gsmar2

an object of class 'gsmar' generated by fitGSMAR or GSMAR, containing the constrained model.

Details

Performs a likelihood ratio test, testing the null hypothesis that the true parameter value lies in the constrained parameter space specified by constraints imposed to the model gsmar2. Under the null, the test statistic is asymptotically χ^2-distributed with k degrees of freedom, k being the difference in the dimensions of the unconstrained and constrained parameter spaces.

Note that this function does not verify that the two models are actually nested. Notably, GSMAR models with different autoregressive orders are not nested, whereas testing models with different numbers of regimes induce an identification problem and thereby unreliable test results (see the discussion related to Theorem 2 in Virolainen, 2021).

Value

A list with class "htest" containing the following components:

statistic

the value of the likelihood ratio statistics.

parameter

the degrees of freedom of the likelihood ratio statistic.

p.value

the p-value of the test.

alternative

a character string describing the alternative hypothesis.

method

a character string indicating the type of the test (likelihood ratio test).

data.name

a character string giving the names of the supplied models, gsmar1 and gsmar2.

gsmar1

the supplied argument gsmar1

gsmar2

the supplied argument gsmar2

References

See Also

Wald_test, fitGSMAR, GSMAR, diagnostic_plot, profile_logliks, quantile_residual_tests, cond_moment_plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# GMAR p=1, M=2 model:
fit12 <- fitGSMAR(simudata, p=1, M=2, model="GMAR", ncalls=1, seeds=1)

# GMAR p=1, M=2 model with AR parameters restricted to be the same in both
# regimes:
fit12r <- fitGSMAR(simudata, p=1, M=2, model="GMAR", restricted=TRUE,
                   ncalls=1, seeds=1)

# Test with likelihood ratio test whether the AR parameters are the same in
# both regimes:
LR_test(fit12, fit12r)

uGMAR documentation built on Jan. 24, 2022, 5:10 p.m.