ad_test_ig: Goodness-of-Fit and Diagnostic Tests for Inverse Gaussian...

View source: R/igp_diagnostics.R

ad_test_igR Documentation

Goodness-of-Fit and Diagnostic Tests for Inverse Gaussian Process Models

Description

Evaluates the Anderson-Darling goodness-of-fit test for Inverse Gaussian degradation increments and computes Likelihood Ratio Tests (LRT) for nested frailty models.

Usage

ad_test_ig(dy, dg, eta)

lr_test(model0, model1)

Arguments

dy

Numeric vector of observed degradation increments.

dg

Numeric vector of evaluated mean function increments \Delta g_\theta(t).

eta

Precision/scale parameter \eta > 0.

model0, model1

Fitted objects of class "igp_fit" representing the null (nested) and alternative models.

Details

The Anderson-Darling statistic A^2 tests the null hypothesis that the observed degradation increments follow the specified Inverse Gaussian distribution:

A^2 = -n - \frac{1}{n} \sum_{i=1}^n (2i - 1) \left[ \log(u_{(i)}) + \log(1 - u_{(n - i + 1)}) \right]

where u_{(i)} are the sorted probability integral transformed residuals u_i = F_{\text{IG}}(\Delta y_i; \Delta g_i, \eta (\Delta g_i)^2).

The Likelihood Ratio Test statistic compares nested models (e.g., Classical IGP vs IGP-Gamma):

\text{LRT} = 2 (\log L_1 - \log L_0) \sim \chi^2(df)

Value

ad_test_ig returns an object of class "ad_test_ig" containing:

statistic

The computed Anderson-Darling statistic A^2.

p_value

Asymptotic p-value for the test.

n

Sample size.

lr_test returns an object of class "lr_test" containing:

statistic

The LRT test statistic.

df

Degrees of freedom difference.

p_value

P-value based on the chi-squared distribution.

model0_loglik, model1_loglik

Log-likelihoods of both models.

References

Anderson, T. W., & Darling, D. A. (1954). A test of goodness of fit. Journal of the American Statistical Association, 49(268), 765-769. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/01621459.1954.10501232")}.

See Also

igp_fit

Examples

data(laser)
fit_none <- igp_fit(laser, time_col = "t", deg_col = "increase",
                    unit_col = "unit", frailty = "none")
fit_gamma <- igp_fit(laser, time_col = "t", deg_col = "increase",
                     unit_col = "unit", frailty = "gamma")

# LRT comparing IGP vs IGP-Gamma
lr_test(fit_none, fit_gamma)


IGPFrailty documentation built on Aug. 25, 2026, 9:08 a.m.