Returns a similar object fitted with columns of the constraint matrices amalgamated so it is a partially parallel VGLM object. The columns combined correspond to certain crossing quantiles. This applies especially to an extlogF1() VGLM object.
fix.crossing.vglm(object, maxit = 100, trace = FALSE, ...)
an object such as
values for overwriting components in
additional optional arguments. Currently unused.
The quantile crossing problem has been described as
disturbing and embarrassing.
This function was specifically written for
vglm with family function
It examines the fitted quantiles of
object to see if any cross.
If so, then a pair of columns is combined to make those
two quantiles parallel.
After fitting the submodel it then repeats testing for
crossing quantiles and repairing them, until there is
no more quantile crossing detected.
Note that it is possible that the quantiles cross in
some subset of the covariate space not covered by the
This function is fragile and likely to change in the future.
extlogF1 models, it is assumed
data has been assigned a data frame,
that the default values of the argument
has been used; this means that the second constraint
The constraint matrix of the intercept term remains unchanged
An object very similar to the original object, but with possibly different constraint matrices (partially parallel) so as to remove any quantile crossing.
## Not run: ooo <- with(bmi.nz, order(age)) bmi.nz <- bmi.nz[ooo, ] # Sort by age with(bmi.nz, plot(age, BMI, col = "blue")) mytau <- c(50, 93, 95, 97) / 100 # Some quantiles are quite close fit1 <- vglm(BMI ~ ns(age, 7), extlogF1(mytau), bmi.nz, trace = TRUE) plot(BMI ~ age, bmi.nz, col = "blue", las = 1, main = "Partially parallel (darkgreen) & nonparallel quantiles", sub = "Crossing quantiles are orange") fix.crossing(fit1) matlines(with(bmi.nz, age), fitted(fit1), lty = 1, col = "orange") fit2 <- fix.crossing(fit1) # Some quantiles have been fixed constraints(fit2) matlines(with(bmi.nz, age), fitted(fit2), lty = "dashed", col = "darkgreen", lwd = 2) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.