Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

confintModel

Confidence intervals for model parameters


Description

Computes confidence intervals for one or more parameters in a fitted model, based on the profiles of a specified objective.

Usage

confintModel(fitted, quantile = qchisq(0.95, 1), verbose = TRUE,
             endpoint.tolerance = 1e-3, max.zoom = 100,
             zero.bound = 1e-08, stepsize = 0.5, stdn = 5,
             gridsize = 20, scale = FALSE, which = 1:length(coef(fitted)),
             objective = stop("'objective' is missing."),
             agreement = TRUE, method = "smooth",
             n.interpolations = 100, ...)


## S3 method for class 'profileModel'
profConfint(prof, method = "smooth",
endpoint.tolerance = 1e-3, max.zoom = 100, n.interpolations = 100,
verbose = FALSE, ...)


## S3 method for class 'profileModel'
profZoom(prof, max.zoom = 100, endpoint.tolerance = 1e-03,
        verbose = FALSE, ...)

## S3 method for class 'profileModel'
profSmooth(prof, n.interpolations = 100, ...)

Arguments

fitted

a glm-like fitted object with linear predictor (see Details of profileModel for the methods that have to be supported by fitted).

prof

a "profileModel" object with non-NULL quantile.

quantile

The quantile to be used for the construction of the confidence intervals. The default is qchisq(0.95, 1).

verbose

if TRUE (default) progress indicators are printed during the progress of calculating the confidence intervals.

endpoint.tolerance

the tolerance on the absolute difference of the value of the profile at the endpoints from the quantile used. Only relevant when confidence intervals are constructed via the "profZoom" method (see Details).

max.zoom

the maximum number of iterations that the binary search algorithm will take towards the achievement of endpoint.tolerance.

zero.bound

same as in profileModel.

stepsize

same as in profileModel.

stdn

same as in profileModel.

gridsize

same as in profileModel.

scale

same as in profileModel.

which

for which parameters should the confidence intervals be calculated?

objective

same as in profileModel.

agreement

same as in profileModel.

method

the method to be used for the calculation of the confidence intervals. Possible values are "smooth", which is the default, and "zoom" (see Details).

n.interpolations

if method="smooth" the number of interpolations to be used for spline smoothing. The default is 100.

...

for confintModel, further arguments passed to the specified objective. For the methods profZoom, profSmooth and profConfint, further arguments passed to or from other functions.

Details

The confidence intervals methods refer to convex objectives. Objectives that result in disjoint confidence regions are not currently supported.

When the profile object is available and was called with the specification of the appropriate quantile then profConfint should be used. confintModel applies directly to the fitted model and calls profileModel.

When method="zoom" the profZoom method is applied to the "profileModel" object. When method="smooth" the profSmooth method is applied to the "profileModel" object.

The profZoom method relies on a binary search and can find the endpoints of the confidence intervals for a pre-specified tolerance for the absolute difference of the value of the profile at each endpoint from the quantile used. It is a computationally intensive method and is useful in cases where the estimate is infinite and in coverage related simulations.

The profSmooth method, fits a smoothing spline on the points specified by the "profileModel" object and then interpolates the endpoints of the confidence intervals at the specified quantile. It is much faster than profZoom and can safely be used in cases where the profiled objective is nearly quadratic in shape, but could be misleading otherwise.

Both methods can report an infinite endpoint. The detection is based on the intersects component of the "profileModel" object.

profConfint is a wrapper method that collects the capabilities of profZoom and profSmooth.

profSmooth, profZoom and profConfint use the quantile that comes with the "profileModel" object prof.

Value

All the functions return a matrix with columns the endpoints of the confidence intervals for the specified (or profiled) parameters.

Additionally, confintModel and profConfint have an attribute carrying the name of the fitted object and the name of the "profileModel" object, respectively.

Author(s)

Ioannis Kosmidis <email: ioannis.kosmidis@warwick.ac.uk>

See Also

Examples

## Not run: 
## Begin Example: quasi likelihood estimation.
## Incidence of leaf-blotch on barley
## McCullagh and Nelder (1989), pp. 328--332
library(gnm)
data(barley)
logitModel <- glm(y ~ site + variety, family = wedderburn, data = barley)
profQuasi <- profileModel(logitModel, objective = "ordinaryDeviance",
                          quantile=qchisq(0.95, 1),
                          which = paste("variety",c(2:9,"X"),sep=""))
# very accurate confidence intervals (with endpoints accurate up to 10
# decimals) for the variety parameters using profConfint with
# method="zoom":
c1 <- profConfint(profQuasi, endpoint.tolerance = 1e-10, maxit = 100,
                  method="zoom" )
# confidence intervals using smoothing:
c2 <- profConfint(profQuasi, method="smooth" )
# c2 has accurate endpoints at least up to four decimals
# this is because of the quadratic shape of the profiles
plot(profQuasi, cis = c1)
plot(profQuasi, cis = c1, signed = TRUE, print.grid.points = TRUE)
# pairs plot
pairs(profQuasi)
# Notice the direction of the pairs plots. The fact that the
# correlations among the estimates are 1/2 is clear.

# profiling using the Rao score statistic
# This can be used as deviance in cases were a quasi likelihood does not
# exist.
profRao <- update(profQuasi, objective = "RaoScoreStatistic",
                  X = model.matrix(logitModel))
## End Example

## End(Not run)

profileModel

Profiling Inference Functions for Various Model Classes

v0.6.1
GPL (>= 2)
Authors
Ioannis Kosmidis [aut, cre] (<https://orcid.org/0000-0003-1556-0302>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.