rMM: Random samples from the multiplicative multinomial

rMMR Documentation

Random samples from the multiplicative multinomial

Description

Density, and random samples drawn from, the multiplicative multinomial

Usage

rMM(n, Y, paras, burnin = 4*Y, every = 4*Y, start = NULL)
dMM(Y, paras)

Arguments

n

Number of observations to make

Y

Sum of each observation (for example, 100 for the pollen dataset, 4 for voting)

paras

Parameters of the MM distribution; an object of class paras

every

Each row is recorded every every steps through the Markov chain. Thus every=10 means every tenth row is written to the returned matrix during MH process (and the other nine values are discarded)

burnin

Number of initial observations to ignore

start

Observation to start simulation, with default NULL corresponding to using a random start vector

Details

Function rMM() uses standard Metropolis-Hastings simulation.

Function dMM() is documented here for convenience; see help(MM) for related functionality.

Value

Returns a matrix with n rows and length(paras) columns. Each row is an observation.

Author(s)

Robin K. S. Hankin

See Also

MM

Examples

data(voting)
rMM(10,4,Lindsey(voting,voting_tally))

p <- paras(3)
theta(p) <- 2
dMM(1:3,p)


MM documentation built on Aug. 23, 2023, 1:08 a.m.