Learn R Programming

supportInt (version 1.1)

calibSI: Attempts to find a support interval with the desired confidence level for binomial, poisson or normal data.

Description

This function performs a grid search to find the lowest support level that has the desired coverage probability. It begins by searching a grid of relative likelihood values using a fixed number of parametric bootstraps at each point. The likelihood value is then refined using a golden section based search.

Usage

calibSI(dat, n = NULL, family, conf.level = 0.95, B = 2000, gridlo = 4, gridhi = 20, gridix = 2, tol = 0.03)

Arguments

dat
This argument is the number of success if family='binomial', the number of occurences if family='poisson', or a vector of normal draws if family='normal'.
n
Number of trials if family='binomial'
family
Data type entered, accepts "binomial", "poisson", "pois", "gaussian", "normal"
conf.level
target confidence level
B
Number of parametric bootstraps to use to estimate coverage probability after the initial grid search.
gridlo
Lowest relative likelihood considered in the initial grid search
gridhi
Highest relative likelihood considered in the initial grid search
gridix
size of steps to be checked between gridlo and gridhi in initial search
tol
acceptable error in the likelihood support level returned

Value

Examples

Run this code
set.seed(10)
calibSI(rnorm(15), family="normal", conf.level=.95, B=1000)

Run the code above in your browser using DataLab