Learn R Programming

simPH (version 0.7.2)

SpinBounds: Internal function for finding the lower and upper bound of the shortest probability interval.

Description

SpinBounds is an internal function used by simPH's simulation commands to find the shortest probability interval. It is largely drawn from Liu's (2013) SPIn command (version 1.1), with two modifications. First it returns just the lower or upper bound of the interval, rather than the whole SPIn object. Second, if there is no variation in the interval (as the hazard ratio for a fitted value of 0, e.g. all simulation values are 1) it takes the "central interval" of the simulations. Effectively it reduces the number of simulations by nsim * ci.

Usage

SpinBounds(x, conf = 0.95, LowUp = NULL, bw = 0, lb = 0,
    ub = Inf, l = NA, u = NA)

Arguments

x
the name of the simulated quantities of interest variable
conf
numeric confidence level
LowUp
numeric specifying if you want to find the lower or upper bound of the interval. Possible options include 1 (Low) or 2 (High).
bw
scalar, the bandwidth of the weighting kernel in terms of sample points. If not specified, sqrt(n) will be used, where n is the sample size.
lb,ub
scalars, the lower and upper bounds of the distribution. If specified, a pseudo-sample point equal to the corresponding bound will be added. By default, lb = 0 as this is the relevant lower bound for quantities of interest from surviv
l,u
scalars, weighting centers (if provided).

Details

SpinBounds internal function for finding the lower bound from SPIn. This function and documentation is largely based directly on the original SPIn command by Ying Liu.

References

Liu, Ying, Andrew Gelman, and Tian Zheng. 2013. ''Simulation-Efficient Shortest Probablility Intervals.'' Arvix. http://arxiv.org/pdf/1302.2142v1.pdf.