makeDbdpars {dbd}R Documentation

Create an object of class "Dbdpars".

Description

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

Usage

makeDbdpars(alpha, beta, ntop, zeta, ndata)

Arguments

alpha

The first “shape” parameter of the db distribution.

beta

The second “shape” parameter of the db distribution.

ntop

Integer scalar, strictly greater than 1. The maximum possible value of the db distribution.

zeta

Logical scalar. Should zero origin indexing be used? I.e. should the range of values of the distribution be taken to be {0,1,2,...,ntop} rather than {1,2,...,ntop}? Setting zeta=TRUE may be appropriate for example when the values of the distribution are to be interpreted as counts.

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 "Dbdpars" which is a list with components alpha, beta, ntop, zeta 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.Dbdpars()

Examples

   obj1  <- makeDbdpars(alpha=2,beta=3,ntop=20,zeta=TRUE,ndata=500)
   obj2  <- makeDbdpars(alpha=0.2,beta=0.25,ntop=20,zeta=FALSE,ndata=30*(1:10))
   sdat1 <- simulate(obj1,nsim=100)
   sdat2 <- simulate(obj2,nsim=100)
   sdat3 <- simulate(obj2,nsim=10)
   sdat4 <- simulate(obj2,nsim=100,ndata=100*(2:6)) # The ndata component of
                                                    # obj2 is ignored.

[Package dbd version 0.0-22 Index]