| copsd | R Documentation |
Returns a distance measure for how far regression coefficients are from the parameter space interior, so that warning can be given if they are too close to the parameter space boundary, for a fitted VGLM.
copsd(object, ...)
copsdvglm(object, doffset = 0.1, ...)
object |
A |
doffset |
Numeric, positive and of unit length. Called the denominator offset. |
... |
fed into |
The values returned by this function can be thought of as scaled distances. They are diagnostic for assessing whether there are boundary problems in the regression. The model must have a Centre of the Parameter Space (COPS) in the interior, e.g., it excludes ordinary Poisson regression. If the computed COPS is too large, relative to the regression coefficient, in that is indicative of there being boundary problems. A value of 5 is recommended for concluding that statistical inference is fraught. Higher values indicate a worsening problem. Common reasons for trouble are linearly separable problems and outliers.
An S3 version of this function is available,
called copsd3.glm,
because the convergence criteria for
vglm and glm
differ.
The latter iterates closer to the parameter space
boundary in general, so the COPSDs can be higher.
The COPSD is probably a better alternative to the WSDM. Both should ideally be used to assess a fitted model.
A named vector, similar to coefvlm.
Some minor changes might occur in the short- to medium-term future.
Initially, “d” stood for “divergence”
because regression coefficients start exploding
during IRLS iterations,
but the values returned by this function are not
divergence measures in the strict sense because there
are no probability distributions as such.
However, the values here do tend to Inf
as violations to the regularity conditions
worsen.
Thomas W. Yee.
Yee, T. W. (2025). Mapping the parameter space by the WSDM function: A diagnostic for logistic regression and beyond. In preparation.
cops,
wsdm,
binomialff,
multinomial,
hdeff,
coefvlm,
coef,
fbeetle.
## Not run: # Example 1: flour beetles
copsd3(glm(cbind(dead, n-dead) ~ logdose, binomial , fbeetle))
copsd(vglm(cbind(dead, n-dead) ~ logdose, binomialff, fbeetle))
# Example 2: quasi-separation
Nmax <- 25
data1 <- data.frame(y = c(rep(0, Nmax), 1, rep(1, Nmax-1)),
x = c(seq(0, 0.5, len = Nmax), seq(0.5, 1, len = Nmax)))
copsd3(glm(y ~ x, binomial, data1, maxit = 3, tr = TRUE)) # OK
copsd3(glm(y ~ x, binomial, data1, tr = TRUE)) # Not OK
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.