Description Usage Arguments Details Value Examples
Sample nsamples
times from a categorical
distribution with probabilities given by normalized_weights
.
1 | multinomial_resampling(nsamples, normalized_weights)
|
nsamples |
is a number of desired samples |
normalized_weights |
is a vector of probabilities (non-negative values summing to one) |
This implementation is in C++, based on drawing sorted uniforms.
a vector of nsamples
integers between 1 and the size of normalized_weights
.
1 2 3 4 5 | N <- 1000
logweights <- rnorm(N)
normalize_weight_results <- normalize_weight(logweights)
normalized_weights <- normalize_weight_results$nw
multinomial_resampling(10, normalized_weights)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.