ruvlambda: 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 parameters u,v, and lambda in the hierarchical model

Usage

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

Arguments

n

number of values to generate

nMNO

non-negative integer vector with the number of individuals detected in each cell according to the network operator

nReg

non-negative integer vector with the number of individuals detected in each cell according to the register

fu

named list with the prior marginal distribution of the parameter u

fv

named list with the prior marginal distributions of the parameter v

flambda

named list with the prior distribution of the 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 3 with the number of strata in each dimension. Default value is c(1, 1e2, 1e2)

verbose

logical (default FALSE) to report progress of the computation

nThreads

number (default the number of all cores, including logical cores) to use for computation

Details

The points are generated according to the accept-reject method using as candidate distribution the unnormalised distribution given by

\mathbb{P}(u, v, λ|N^{\textrm{MNO}})\propto\mathbb{P}(u,v|λ, N^{\textrm{MNO}}) \cdot\mathbb{P}(λ|N^{\textrm{MNO}})

.

The prior distributions are specified as named lists where the first component of each list must be the name of distribution ('unif', 'triang', '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

ruvlambda generates n points according to the posterior distribution of the parameters u, v, λ. The function returns a data.table with these points.

See Also

rlambda, duvlambda

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
ruvlambda(10, nMNO = 20, nReg = 115, 
          fu = list('unif', xMin = 0.10, xMax = 0.20),
          fv = list('unif', xMin = 100, xMax = 120),
          flambda = list('gamma', shape = 11, scale = 12))
          
          
ruvlambda(10, nMNO = c(19, 20), nReg = c(115, 117), 
          fu = list(list('unif', xMin = 0.10, xMax = 0.20),
                    list('unif', xMin = 0.11, xMax = 0.22)),
          fv = list(list('unif', xMin = 100, xMax = 120),
                    list('unif', xMin = 97, xMax = 123)),
          flambda = list(list('gamma', shape = 11, scale = 105 / 10),
                         list('gamma', shape = 12, scale = 1107 / 11)))
          

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