Learn R Programming

SPIn (version 1.1)

bootSPIn: SPIn with Bootstrap

Description

Compute the shortest probability interval (spin) using SPIn with bootstrap.

Usage

bootSPIn(x, n.boot = 50, conf = 0.95, bw = 0, lb = -Inf, ub = Inf, l = NA, u = NA)

Arguments

x
A vector of samples from the distribution.
n.boot
Number of bootstraps.
conf
Scalar, the confidence level desired.
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.
l,u
Scalars, weighting centers (if provided).

Value

  • spin.boot returns an object of class 'SPIn'. An object of class 'SPIn' is a list containing the following components:
  • spinA vector of length 2 with the lower and upper endpoints of the interval.
  • confThe confidence level.
  • xA vector of samples from the distribution.
  • w.l,w.uVectors of the computed weights.
  • l.l,l.u,u.l,u.uEndpoints of the weights.

Details

spin.boot computes the shortest probability interval for a distribution using SPIn with bootstrap.

References

Simulation efficient shortest probability intervals. (arXiv:1302.2142)

See Also

plot.SPIn,SPIn

Examples

Run this code
x <- rgamma(100,3)
bootSPIn(x)

Run the code above in your browser using DataLab