bisect: Bisection search

Description Usage Arguments Value Author(s) Examples

Description

Implements basic bisection search for root finding. In contrast to uniroot this can also deal with the case where the result of fun is binary - in this case the bisect finds the changepoint.

Usage

1
bisect(lower, upper, fun, tol = 1e-04, ...)

Arguments

lower

lower bound of search range

upper

upper bound of search range

fun

function whose root is to be found

tol

error tolerance

...

additional arguments to be passed to the function

Value

root

Author(s)

float

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
set.seed(5449219)
x <- rnorm_cont(16,25,8,cshift=0,csd=24)
y <- rnorm_cont(16,19,8,cshift=0,csd=24)
cond_power_rule_norm_ts(x[1:8],y[1:8],delta=6,target=.8,rob_var=F)
nE <- cond_power_rule_norm_ts(x[1:8],y[1:8],delta=6,target=.8,rob_var=T)
xE <- rnorm_cont(nE-16,25,8,cshift=0,csd=24)
yE <- rnorm_cont(nE-16,19,8,cshift=0,csd=24)


combtest <- function(delta,alpha){
   adaptive_invnormtest_2s(c(y,yE)+delta,c(x,xE),8,16,nE,alpha=alpha)
}

bisect(-10, 10, combtest, alpha = 0.5)

floatofmath/adaperm documentation built on May 16, 2019, 1:18 p.m.