wtpolyap: Polya sampling from an urn with possibly unequal weights

Description Usage Arguments Value Examples


Consider an urn containing a finite set of values along with their respective positive weights. An item is selected at random from the urn with probability proportional to its weight. Then it is returned to the urn and its weight is increased by one. The process is repeated on the adjusted urn. We continue until the total weight in the urn has been increased by k. The original composition of the urn along with the k selected values, in order, are returned.


wtpolyap(ysamp, wts, k)



A vector of real numbers which make up the urn.


A vector of positive weights which defines the initial probability of selection.


A positive integer which specifies the number of Polya samples taken from the urn where after each draw the weight of the selected item is increased by one.


The returned value is a vector of length equal to the length of the sample plus k



Search within the polyapost package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.