Description Usage Arguments Details Value Methods (by generic) Examples
View source: R/sample.ballbin.R
sample.ballbin
generates simulated data from the extended balls-in-bins process.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | sample.ballbin(n, size, space, prob, alloc.prob = NULL)
## S3 method for class 'ballbin'
print(x, ...)
## S3 method for class 'ballbin'
plot(
x,
...,
ball.size = NULL,
ball.color = NULL,
ball.colour = ball.color,
max.plots = 30
)
## S3 method for class 'ballbin'
summary(object, ...)
## S3 method for class 'summary.ballbin'
print(x, ...)
## S3 method for class 'summary.ballbin'
plot(x, ..., bar.color = NULL, bar.colour = bar.color)
|
n |
The number of simulations of the process |
size |
The size parameter for the occupancy distribution (number of balls) |
space |
The space pararmeter for the occupancy distribution (number of bins) |
prob |
The probability parameter for the occupancy distribution (probability of ball occupying its bin) |
alloc.prob |
(Optional) A probability vector for the allocation probabilities for the bins |
x, object |
ballbin objects (for generics) |
... |
unused |
ball.size, ball.color, ball.colour, max.plots |
Set the size, color, and number of plots |
bar.color, bar.colour |
plotting arguments |
This function generates a simulated set of data from the extended balls-in-bins process. The outcome is an
object of class ballbin
containing the simulations from the process. The output object contains the
initial bin-allocation and resulting samples from the process. Calling summary
on the simulation object
creates a new object of class summary.ballbin
containing summary statistics for each sample, including
the bin-counts, effective sample-size, occupancy number, max-count number, and hitting times for each possible
occupancy number. Each of these objects has a custom printing and plot methods to give user-friendly output.
If all inputs are correctly specified (i.e., parameters are in allowable range) then the output will
be a list of class ballbin
containing n
random samples from the process. If you call summary
on this object the output will be another list of class summary.ballbin
containing summary statistics
for each random sample from the process.
print
: prints the sample
plot
: plots the sample
summary
: summarizes the sample
print
: prints the summary
plot
: plots the summary
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.