Learn R Programming

FVDDPpkg (version 0.1.2)

polya.sample: Sampling via Polya Urn scheme

Description

Sampling via Polya Urn scheme

Usage

polya.sample(n, theta, v = c(), sampling.f)

Value

A vector containing n values extracted.

Arguments

n

The amount of samples to be drawn.

theta

The intensity, in the sense of Bayesian Statistics

v

A vector of values, considered to be already drawn from the Polya scheme.

sampling.f

A function to sample new values. Its unique argument must express the number of values to draw.

Examples

Run this code
polya.sample(10, 2, c(0,1), function(x) rbeta(x,1,1))

Run the code above in your browser using DataLab