Description Usage Arguments Details Value See Also Examples
Generate random points according to the posterior probability distribution of the parameters u,v, and lambda in the hierarchical model
1 2 3 |
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 |
fv |
named list with the prior marginal distributions of the parameter |
flambda |
named list with the prior distribution of the parameter λ |
relTol |
relative tolerance in the computation of the |
nSim |
number of two-dimensional points to generate to compute the integral. Default value
is |
nStrata |
integer vector of length 3 with the number of strata in each dimension. Default
value is |
verbose |
logical (default |
nThreads |
number (default the number of all cores, including logical cores) to use for computation |
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:
unif: xMin
, xMax
for the minimum, maximum of the sampled interval.
degen: x0
for the degenerate value of the random variable.
triang: xMin
, xMax
, xMode
for minimum, maximum and mode (see
qtriang
).
gamma: scale
and shape
with the same meaning as in rgamma
.
ruvlambda
generates n
points according to the posterior distribution of
the parameters u, v, λ. The function returns a data.table with these
points.
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)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.