resample_multinomial: Draw Multinomial Random Sample

resample_multinomialR Documentation

Draw Multinomial Random Sample

Description

Draws a random (sub)sample from a multinomial distribution.

Usage

resample_multinomial(object, ...)

## S4 method for signature 'numeric'
resample_multinomial(object, n, size = sum(object), ...)

Arguments

object

A length-k integer vector, specifying the probability for the k classes; is internally normalized to sum to 1.

...

Currently not used.

n

A non-negative integer specifying the number of random vector to draw.

size

A non-negative integer specifying the sample size.

Value

A numeric matrix with n rows and k columns.

Author(s)

N. Frerebeau

See Also

stats::rmultinom()

Other resampling methods: bootstrap(), jackknife(), resample_uniform()

Examples

## Uniform distribution
x <- rnorm(20)
resample_uniform(x, n = 10)

## Multinomial distribution
x <- sample(1:100, 20, TRUE)
resample_multinomial(x, n = 10)

tesselle/arkhe documentation built on June 15, 2025, 12:05 a.m.