Learn R Programming

AdapSamp (version 1.1.1)

rASS: Adaptive Slice Sampling Algorithm With Stepping-Out Procedures

Description

rASS generates a sequence of random numbers by the adaptive slice sampling algorithm with stepping-out procedures.

Usage

rASS(n, x0 = 0, formula, w = 3)

Arguments

n

Desired sample size;

x0

Initial value;

formula

Target density function p(x);

w

Length of the coverage interval.

References

Neal R M. Slice sampling - Rejoinder[J]. Annals of Statistics, 2003, 31(3):758-767.

Examples

Run this code
# NOT RUN {
# Example 1: Sampling from exponential distribution with bounded domain
x<-rASS(100,-1,"1.114283*exp(-(4-x^2)^2)",3)
plot(density(x))

# }

Run the code above in your browser using DataLab