Description Usage Arguments Value Examples
View source: R/sampleFeatureAllocation.R
This function obtains a sample from a previously defined feature allocation
distribution object using wither the ibp
or the aibd
functions.
1 2 3 4 5 6 | sampleFeatureAllocation(
nSamples,
distribution,
implementation = "scala",
parallel = TRUE
)
|
nSamples |
An integer giving the number of samples |
distribution |
A feature allocation distribution object as defined in the functions
|
implementation |
The default of "scala" should be used. The "R" option is not a supported implementation. |
parallel |
Whether multiple cores should be used to generate the samples. |
A list of feature allocation matrices sampled from the supplied distribution.
1 2 3 4 5 6 7 8 9 10 | # Regardless of size, the initial warmup can exceed CRAN's 5 seconds threshold
d1 <- ibp(1,4)
states <- c("California","Wisconsin","Nebraska","New York")
data <- USArrests[states,]
dist <- dist(scale(data))
d2 <- aibd(1, seq_along(states), 1.0, dist)
samples_ibp <- sampleFeatureAllocation(10, d1, parallel=FALSE)
samples_aibd <- sampleFeatureAllocation(15, d2, parallel=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.