makeBbdpars {dbd}R Documentation

Create an object of class "Bbdpars".

Description

Create an object of class "Bbdpars" which may be used as an argument of the simulate() function.

Usage

makeBbdpars(m, s, size, ndata)

Arguments

m

Numeric scalar between 0 and 1. May be interpreted as a “success probability”.

s

Numeric scalar, greater than 0. The overdispersion parameter of the beta binomial distribution. Note that if overdispersion is defined to equal the ratio of the variance of the data to the corresponding “binomial variance” (i.e. the actual variance over m*(1-m)*size) the overdispersion tends to 0 as s tends to infinity and to size as s tends to 0.

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}.

ndata

Integer vector specifying the lengths of the data sets to be simulated. If it is of length less than the nsim argument of simulate() (e.g. if it is a scalar) then it is “recycled” to provide a vector of length nsim. If is longer than nsim, then only the first nsim entries are used and the others are ignored. If the argument ndata of the simulate() function is supplied then the ndata component specified here is ignored by simulate().

Value

An object of class "Bbdpars" which is a list with components m, s, size and ndata. The entries of this list are simply the corresponding function arguments.

Author(s)

Rolf Turner r.turner@auckland.ac.nz

See Also

simulate.Bbdpars()

Examples

   obj1  <- makeBbdpars(m=0.35,s=0.3,size=20,ndata=500)
   obj2  <- makeBbdpars(m=0.85,s=1.7,size=20,ndata=30*(1:10))
   ## Not run: 
       sdat1 <- simulate(obj1,nsim=100)
       sdat2 <- simulate(obj2,nsim=100)
   
## End(Not run)
   sdat3 <- simulate(obj2,nsim=10)
   ## Not run: 
       sdat4 <- simulate(obj2,nsim=100,ndata=100*(2:6)) # The ndata component of
                                                    # obj2 is ignored.
   
## End(Not run)

[Package dbd version 0.0-22 Index]