# nsubsets.random: Number of Subsets In shallot: Random Partition Distribution Indexed by Pairwise Information

## Description

These functions either sample the number of subsets for supported partition distributions or computes probabilities, means, and variances of these distributions.

## Usage

 ```1 2 3 4 5 6 7``` ```nsubsets.random(x, n.samples) nsubsets.probability(x, n.subsets) nsubsets.average(x) nsubsets.variance(x) ```

## Arguments

 `x` An object of class `shallot.distribution`. `n.samples` An integer containing the number of samples. `n.subsets` An integer containing the number of subsets.

## Value

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.

## Author(s)

David B. Dahl dahl@stat.byu.edu

## References

`partition.distribution`
 ``` 1 2 3 4 5 6 7 8 9 10 11``` ```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) ```