rNtcondN0: Conditioned generation of random deviates of the posterior...

Description Usage Arguments Details Value Examples

Description

Generate random deviates of the posterior distribution of the number of individuals at an arbitrary time instant conditioned upon the initial population.

Usage

1
rNtcondN0(n, N0, nMNOmat, distNames, variation)

Arguments

n

number of values to generate

N0

initial population in each cell

nMNOmat

transition matrix with the number of individuals displaced from cell to cell detected by the Mobile Network Operator

distNames

character vector with the names of the prior distributions for each cell

variation

list of lists whose components are parameters providing a measure of variation of each prior distribution

Details

The function generates the probabilities according to a Dirichlet distribution with parameters generated by alphaPrior. These parameters are generated with distributions whose names are taken from the input parameter distNames and construct the corresponding prior distribution for each cell j with mode at u_{j}^{*}=N_{j}, where N_{j} is taken from the sum of rows of nMNOmat. Next the rest of parameters of the distribution are computed according to the dispersion parameters specified in variation.

As accepted distribution names, currently the user can specify unif, degen, triang, and gamma.

The dispersion parameters recognised so far are the coefficients of variation only (standard deviation divided by the mean of the distribution). These dispersion parameters must be specified by a named component cv with a numeric value in [0, 1].

For each distribution the parameters are computed as follows:

Value

Return a matrix with as many columns as cells and n rows with the generated values

Examples

1
2
3
4
5
N0 <- c(93, 123, 130)
nMNOmat <- rbind(c(10, 3, 4), c(5, 21, 3), c(3, 9, 18))
distNames <- rep('unif', 3)
variation <- rep(list(list(cv = 0.20)), 3)
rNtcondN0(1e3, N0, nMNOmat, distNames, variation)

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