View source: R/igp_diagnostics.R
| ad_test_ig | R Documentation |
Evaluates the Anderson-Darling goodness-of-fit test for Inverse Gaussian degradation increments and computes Likelihood Ratio Tests (LRT) for nested frailty models.
ad_test_ig(dy, dg, eta)
lr_test(model0, model1)
dy |
Numeric vector of observed degradation increments. |
dg |
Numeric vector of evaluated mean function increments |
eta |
Precision/scale parameter |
model0, model1 |
Fitted objects of class |
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)
ad_test_ig returns an object of class "ad_test_ig" containing:
statistic |
The computed Anderson-Darling statistic |
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. |
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")}.
igp_fit
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.