Last chance! 50% off unlimited learning
Sale ends in
These functions either sample the number of subsets for supported partition distributions or computes probabilities, means, and variances of these distributions.
nsubsets.random(x, n.samples)nsubsets.probability(x, n.subsets)
nsubsets.average(x)
nsubsets.variance(x)
An object of class shallot.distribution
.
An integer containing the number of samples.
An integer containing the number of subsets.
Currently ignored.
The nsubsets.random
function returns a vector of
random samples of the number of subsets in the distribution x.
The nsubsets.probability
function returns the probability that
the number of subsets is n.subsets in the distribution x.
Depending on the number of items and the value of n.subsets, this
function can be computationally intensive.
The nsubsets.average
and nsubsets.variance
functions return the mean and variances, respectively, of the number of
subsets in the distribution x.
# NOT RUN {
# }
# NOT RUN {
pd <- ewens.pitman.attraction(
mass(1),
discount(0.05),
attraction(permutation(n.items=50,fixed=FALSE),
decay.exponential(temperature(1.0),dist(scale(USArrests)))))
mean(nsubsets.random(pd,1000))
nsubsets.average(pd)
pde <- ewens(mass(1),50)
nsubsets.variance(pde)
nsubsets.probability(pde,4)
rscala::scalaDisconnect(shallot:::s)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab