Centre of the Parameter Space
cops.RdReturns a vector similar to coef(object),
comprising the centre of the parameter space (COPS)
values,
given a fitted VGLM.
Usage
cops(object, ...)
copsvglm(object, level = 0.999,
beta.range = confint(object, level = level),
muxrange = 4, iter.max = 8, tol = 1e-5, subset = NULL,
do1 = TRUE, slowtrain = FALSE, ...)Arguments
- object
A
vglmobject, e.g., representing a logistic regression.- level
Fed into
confintto obtain an interval for each coefficient. Then the centered confidence limits are multiplied bymuxrangeanditerto widen the interval, so as to allow a gridsearch. Hopefully each maximum is bracketed by two endpoints. So a value oflevelcloser to 1 will mean the initial confidence intervals will be wider.- beta.range
Numeric. Interval for the numerical search. It is common for the COPS to be relatively near the estimated regression coefficients. Argument
levelprovides an initial wide range about these estimates. Alternatively, a 2-column matrix can be inputted to replace the default, where the first column is the lower limit, etc.- muxrange, iter.max
Numeric. Used to obtain the interval endpoints that cover each COPS value. The initial confidence intervals are linearly widened by multiplication by
muxrangeand1:iter.max. This provides the positions for a gridsearch whereby the maximum can be covered. If the highest information value of the is at the most extreme gridpoints (i.e., the first or the last) then a warning is given for the user to increase at least one of these arguments. Note thatmuxrange > 1in order to expand the gridsearch outward.- tol
Numeric. Fed into
tolinoptimize. Probablytolshould only occasionally used, e.g., ifcoef(object)contains some very large or small values.- do1
Logical. Include the intercepts? This operates in conjunction with
subset.- slowtrain
Logical. Used internally, not important.
- subset
Same as in
wsdm. To control whether intercepts are included, usedo1.- ...
currently unused but may be used in the future for further arguments passed into other methods.
Details
For many models, some COPS values will be
Inf or -Inf
so that manual checking is needed,
for example, poissonff.
The answers returned by this function only
make sense if the COPSs are in the
interior of the parameter space.
This function was written specifically for
logistic regression but has much wider
applicability.
Currently the result returned depends critically
on beta.range,
muxrange and iter.max
so that the answer ought to be checked.
Yee (2025) shows that not all VGLMs have a
finite COPS. For example, an intercept-only
propodds with second
cumulative probability less than 0.25 will
not have a finite COPS for the first
intercept.
For now, this function should probably
only applied to
binomialff models
with the four most common link functions.
References
Yee, T. W. (2025). The centre of the parameter space and its mapping with the WSDM function: A diagnostic for logistic regression and beyond. In preparation.
Note
This function could be made more robust in the future. Of course, the function will not return finite results if the COPS is not finite, e.g., a Poisson regression.
Examples
if (FALSE) data("xs.nz", package = "VGAMdata")
data1 <- na.omit(xs.nz[, c("age", "cancer", "sex")])
#> Error: object 'xs.nz' not found
fit1 <- vglm(cancer ~ age + sex, binomialff, data1)
#> Error in eval(mf, parent.frame()): object 'data1' not found
cops(fit1)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'cops': object 'fit1' not found
# \dontrun{}