rlambda: Generation of random deviates of the posterior distribution...

Description Usage Arguments Details Value See Also Examples

Description

Generate random points according to the posterior probability distribution of the parameter lambda in the hierarchical model.

Usage

1
2
3
rlambda(n, nMNO, nReg, fu, fv, flambda, relTol = 1e-06, nSim = 10000,
  nStrata = c(1, 100), verbose = FALSE,
  nThreads = RcppParallel::defaultNumThreads())

Arguments

n

number of values to generate

nMNO,

nReg non-negative integer vectors with the number of individuals detected in each cell according to the network operator and the register

fu,

fv named lists with the prior marginal distributions of the two-dimensional points for the Monte Carlo integration

flambda

named list with the prior distribution of the lambda parameter

relTol

relative tolerance in the computation of the kummer function. Default value is 1e-6

nSim

number of two-dimensional points to generate to compute the integral. Default value is 1e4

nStrata

integer vector of length 2 with the number of strata in each dimension. Default value is c(1, 1e2)

verbose

logical (default FALSE) to report progress of the computation

Details

The points are generated according to the accept-reject method using as candidate distribution a Cauchy distribution whose parameters are taken from the prior distributions and the mode of the posterior distribution of the lambda parameter.

The prior distributions are specified as named lists where the first component of each list must be the name of distribution ('unif', 'triang', 'degen', 'gamma') and the rest components must be named according to the name of the parameters of the random generator of the corresponding distribution according to:

Value

rlambda generates n points according to the posterior distribution of the parameter lambda. The function returns a vector with these points.

See Also

dlambda, rg for related functions.

Examples

1
2
3
4
5
# It takes a couple of minutes
hist(rN0(500, nMNO = 20, nReg = 115, fu = list('unif', xMin = 0.3, xMax = 0.5),
        fv = list('unif', xMin = 100, xMax = 120),
        flambda = list('gamma', shape = 11, scale = 12))$N0,
        breaks = seq(1, 200, by = 1), main ='', xlab = 'number of individuals')

MobilePhoneESSnetBigData/pestim documentation built on May 31, 2019, 2:44 p.m.