Learn R Programming

epistasis (version 0.0.1-1)

episim: Generate discrete ordinal data

Description

Generating discrete ordinal data based on underlying "genome-like" graph structure. The procedure of simulating data relies on a continues variable, which can be simulated from either multivariate normal distribution, or multivariate t-distribution with d degrees of freedom.

Usage

episim ( p = 90, n = 200, k = NULL, g = NULL, adjacent = NULL, alpha = NULL , beta = NULL, con.dist = "Mnorm", d = NULL, vis = FALSE)

Arguments

p
The number of variables. The default value is 90.
n
The number of sample size (observations). The default value is 200.
k
The number of states (categories). The default value is 3.
g
The number of groups (chromosomes) in the graph. The default value is about $p/20$ if $p >= 40$ and 2 if $p < 40$.
adjacent
The number of adjacent variable(s) to be linked to a variable. For example, if adjacent = 1 indicates a variable is linked via an edge with its adjacent variable on the left hand side, and its adjacent variable on the right hand side. The adjacent = 2 defines a variable is linked via an edge with its 2 adjacent variables on its left hand side, and 2 adjacent variables on its right hand side. The default value is 1.
alpha
A probability that a pair of non-adjacent variables in the same group is given an edge. The default value is 0.01.
beta
A probability that variables in different groups are linked with an edge. The default value is 0.02.
con.dist
The distribution of underlying continuous variable. If con.dist = "Mnorm", a multivariate normal distribution with mean 0 is applied. If con.dist = "Mt", the t-distribution with a degrees of freedom is applied. The default distribution is con.dist = "Mnorm".
d
The degrees of freedom of the continuous variable, only applicable when codecon.dist = "Mt". The default value is 3.
vis
Visualize the graph pattern and the adjacency matrix of the true graph structure. The default value is FALSE.

Value

An object with S3 class "episim" is returned:

Details

The graph pattern is generated as below: "genome-like": The p variables are evenly partitions variables into g disjoint groups; the adjacent variables within each group are linked via an edge. With a probability alpha a pair of non-adjacent variables in the same group is given an edge. Variables in different groups are linked with an edge with a probability of beta.

References

P. Behrouzi and E. C. Wit. Detecting Epistatic Selection with Partially Observed Genotype Data Using Copula Graphical Models. arXiv, 2016.

See Also

epistasis, and epistasis-package

Examples

Run this code
## Not run: 
# #genome-like graph structure
# sim1 <- episim(alpha = 0.01, beta = 0.02)
# plot(sim1)
# 
# #genome-like graph structure with more edges between variables in a same or different groups
# sim2 <- episim(adjacent = 3, alpha = 0.02 , beta = 0.03)
# plot(sim2)
# ## End(Not run)

Run the code above in your browser using DataLab