uniroot.integer.mod: Optimizer for Uniroot Integer (Modified)

uniroot.integer.modR Documentation

Optimizer for Uniroot Integer (Modified)

Description

A modified integer-based root-finding algorithm for determining the sample size required to achieve a target power. This function extends the uniroot integer search method to handle cases with stepwise power searches while considering constraints on search limits.

Usage

uniroot.integer.mod(
  f,
  power,
  lower = lower,
  upper = upper,
  step.power = step.power,
  step.up = step.up,
  pos.side = pos.side,
  maxiter = maxiter,
  ...
)

Arguments

f

Function for which a root is needed.

power

Numeric. Target power value.

lower

Integer. Minimum allowable root value.

upper

Integer. Maximum allowable root value.

step.power

Numeric. Initial step size defined as 2^step.power.

step.up

Logical. If TRUE, the search increments from lower; if FALSE, it decrements from upper.

pos.side

Logical. If TRUE, finds the closest integer i such that f(i) > 0.

maxiter

Integer. Maximum number of iterations allowed.

...

Additional arguments passed to f.

Value

A list containing:

root

The integer value closest to the root on the correct side.

f.root

Value of f at the estimated root.

iter

Number of function evaluations performed.

table.iter

A data frame showing estimated sample size (N) and corresponding power at each iteration.

table.test

A data frame containing endpoint-level test results for each simulation and corresponding N.


SimTOST documentation built on April 3, 2025, 9:05 p.m.