ci.bisection: Bisection method for constructing confidence intervals

View source: R/invertci.R

ci.bisectionR Documentation

Bisection method for constructing confidence intervals

Description

This function constructs the two-sided confidence interval of a given testing procedure using the bisection method.

Usage

ci.bisection(
  f,
  farg,
  alpha,
  b0,
  b1,
  tol,
  max.iter,
  pvals,
  progress,
  type,
  dp,
  rngstate,
  para.match
)

Arguments

f

The function that represents a testing procedure.

farg

The list of arguments to be passed to the function of testing procedure.

alpha

The significance level(s). This can be a vector.

b0

The lower bound of the initial bracket.

b1

The upper bound of the initial bracket.

tol

The tolerance level in the bisection method.

max.iter

The maximum number of iterations in the bisection method.

pvals

The data frame that consists the points and the corresponding p-values that have been tested in the previous iterations.

progress

The boolean variable for whether the result messages should be displayed in the procedure of constructing confidence interval. If it is set as TRUE, the messages are displayed throughout the procedure. Otherwise, the messages will not be displayed.

type

The type of the confidence interval. Set type as 1 for the upper bound of the confidence interval and set type as -1 for the lower bound of the confidence interval.

dp

The number of decimal places to be displayed for the p-values and confidence intervals in the messages if progress is set as TRUE.

rngstate

The current RNG state obtained from .Random.seed.

para.match

The list of parameters to be matched.

Value

Return the solution of the bisection method and the updated data frame.

pt

The last test point.

iter

The number of iterations.

pvals

The data frame that consists of the points and the corresponding p-values that have been tested in constructing the confidence intervals.

df_bis

The data frame storing the information for the bisection method in each iteration.

last_iter_msg

The message for the last iteration. This refers to whether why the bisection method stops.


conroylau/lpinfer documentation built on Oct. 23, 2022, 9:21 a.m.