# varBb: Variance of a beta binomial distribution. In dbd: Discretised Beta Distribution

## Description

Calculate the variance of a random variable having a beta binomial distribution.

## Usage

 ```1 2 3 4 5``` ```varBb(mo,...) ## S3 method for class 'mleBb' varBb(mo,...) ## Default S3 method: varBb(mo, s, size, ...) ```

## Arguments

 `mo` For the `"mleBb"` method this argument is an object of class `"mleBb"` as returned by `mleBb()`. For the default method it is a numeric scalar, between 0 and 1, playing the role of `m` (which may be interpreted as the “success” probability). (See the help for `dbetabinom()`.) `s` Numeric scalar, greater than 0. The overdispersion parameter of the distribution. (See the help for `dbetabinom()`.) `size` Integer scalar specifying the upper limit of the “support” of the beta binomial distribution under consideration. The support is the set of integers `{0, 1, ..., size}`. (See the help for `dbetabinom()`.) `...` Not used.

## Details

For the `"mleBb"` method, the single argument should really be called (something like) “`object`” and for the default method the first argument should be called `m`. However the argument lists must satisfy the restrictions that “A method must have all the arguments of the generic, including ... if the generic does.” and “A method must have arguments in exactly the same order as the generic.

For the `"mleBb"` method, the values of `m` and `s` are obtained from `mo`, and `size` is extracted from the attributes of `mo`.

The variance of a beta binomial distribution is readily calculable “by hand”. These functions are provided for convenience and to preserve parallelism with the db distribution.

## Value

Numeric scalar equal to the variance of a beta binomial distributed random variable with the given parameters.

## Author(s)

Rolf Turner r.turner@auckland.ac.nz

`varDb()` `expValDb()` `expValBb()`
 ```1 2 3 4 5``` ``` varBb(0.7,0.1,15) varBb(0.7,400,15) X <- hmm.discnp::Downloads fit <- mleBb(X,size=15) varBb(fit) ```