## Compute the number of children of a randomly chosen node

### Description

`cladesize` takes a random internal node in a tree, and computes its number of descendants (clade size).

### Usage

```cladesize(tree)
```

### Arguments

 `tree` An object of class `"treeshape"`.

### Details

This function can be used to check whether a tree fits the Yule or the PDA models. Under the Yule model, the probability distribution of the random clade size is equal to

P(Kn=k)=2*n/((n-1)*k(k+1))

for k = 2, 3, …, n-1 and

P(Kn=n)=1/(n-1)

(where n is the number of tips of the tree and Kn is the number of descendents of an internal node of the tree). Under the PDA model, the asymptotic distribution (when the number of tips grows to infinity) of the random clade size is equal to

P(K=k+1)=choose(2*k,k)/((k+1)*(2^k)^2)

.

### Value

An object of class `numeric` representing the clade size of a random node of a tree.

### Author(s)

Michael Blum <michael.blum@imag.fr>
Nicolas Bortolussi <nicolas.bortolussi@imag.fr>
Eric Durand <eric.durand@imag.fr>
Oliver Francois <olivier.francois@imag.fr>

### References

Blum, M., Francois, O. and Janson, S. The mean, variance and limiting distribution of two statistics sensitive to phylogenetic tree balance; manuscript available from
http://www-timc.imag.fr/Olivier.Francois/bfj.pdf.

### Examples

```
# Histogram of random clade sizes
main="Random clade sizes for random generated trees"