llr_vuong: Vuong's closeness test

Description Usage Arguments Value References Examples

View source: R/llr_vuong.R

Description

Likelihood ratio test for model selection using the Kullback-Leibler information criterion \insertCitevuong1989likelihooddistributionsrd

Usage

1
llr_vuong(x, y, np.x, np.y, corr = c("none", "BIC", "AIC"))

Arguments

x, y

vector of log-likelihoods

np.x, np.y

Number of paremeters respectively

corr

type of correction for parameters, defaults to none.

Value

returns data frame with test statistic, p-value and character vector indicating the test outcome.

References

\insertAllCited

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
x <- rlnorm(1e4, meanlog = -0.5, sdlog = 0.5)
pareto_fit <- combdist.mle(x = x, dist = "pareto")
pareto_loglike <- dcombdist(x = x, dist = "pareto", coeff = pareto_fit$coefficients, log = TRUE)
lnorm_fit <- combdist.mle(x = x, dist = "lnorm")
lnorm_loglike <- dcombdist(x = x, dist = "lnorm", coeff = lnorm_fit$coefficients, log = TRUE)

llr_vuong(x = pareto_loglike, y = lnorm_loglike, np.x = pareto_fit$np, np.y = lnorm_fit$np)

# BIC type parameter correction
llr_vuong(x = pareto_loglike, y = lnorm_loglike, np.x = pareto_fit$np, np.y = lnorm_fit$np,
corr = "BIC")

# AIC type parameter correction
llr_vuong(x = pareto_loglike, y = lnorm_loglike, np.x = pareto_fit$np, np.y = lnorm_fit$np,
corr = "AIC")

distributionsrd documentation built on July 1, 2020, 10:21 p.m.