StrainRanking (version 1.2)

DGobj.simul.regression: Simulation of a DG object under a regression model

Description

Simulation of a DG object under a regression model generating proportions of pathogen strains in each node of a square grid.

Usage

DGobj.simul.regression(sqrtn, size1, size2, theta, alpha.function, sigma,
 plots = FALSE)

Arguments

sqrtn

[Positive integer] Side size of the square grid over which the proportions are simulated. The inter-node distance in the grid is one in the horizontal and vertical directions. The total number of grid nodes is sqrtn^2.

size1

[Positive integer] Number of grid nodes where pathogen isolates are collected (sampling sites).

size2

[Positive integer] Number of pathogen isolates sampled in each sampling site.

theta

[Vector of numerics] Regression coefficients representing the fitness of the strains. The length of this vector determines the number of strains.

alpha.function

[Function] Function whose value is a matrix of positive numerics with number of columns equal to the number of strains and the number of rows is the number of grid nodes. Each row of the matrix provides the parameters of the Dirichlet distribution used to draw the proportions of strains at each node. The argument of the function is a 2-column matrix of coordinates.

sigma

[Postive numeric] Standard deviation of the white noise.

plots

[Logical] If TRUE, plots are produced. The plots show the proportion of each strain in space.

Value

An object from the DG class.

References

Soubeyrand S., Tollenaere C., Haon-Lasportes E. & Laine A.-L. (2014). Regression-based ranking of pathogen strains with respect to their contributions to natural epidemics. PLOS ONE 9(1): e86591.

See Also

DGobj-class, DGobj.rawdata, DGobj.simul.mechanistic, generation.alpha.3strains

Examples

Run this code
# NOT RUN {
## Simulation of a data set
DGreg=DGobj.simul.regression(sqrtn=10, size1=30, size2=10, theta=c(1.5,2,3), 
	alpha.function=generation.alpha.3strains, sigma=0.1)
summary(DGreg)

## Simulation of a data set and plots of the proportions in space the strains
DGreg=DGobj.simul.regression(sqrtn=10, size1=30, size2=10, theta=c(1.5,2,3), 
	alpha.function=generation.alpha.3strains, sigma=0.1,plots=TRUE)
summary(DGreg)
# }

Run the code above in your browser using DataCamp Workspace