Generates random event occurrence data based on an oncogenetic tree model.
1 2 3
The required sample size.
An object of the class
A logical value specifying whether false positive and negative errors should be applied.
A choice of whether the observed or estimated
edge transition probabilities should be used in the calculation
of probabilities. See
Simulation method, see Details for explanation of the options.
There are three choices for the method of simulation; the best choice depends on the size of the tree, required sample size, and whether errors are needed.
Method “S” generates the data based on the conditional probability definition
of the oncogenetic tree, and then ‘corrupts’ the resulting sample by
introducing random errors. This method is applicable in all circumstances, but can
be slower than other methods if
N is large and
Method “D1” calculates the joint distribution generated by the
tree exactly (using
and the observations are generated by sampling this distribution. Thus if
with.errors=TRUE and the tree is large, this method might fail due
to the exponential growth in the number of potential outcomes. On the
other hand, for a moderately sized tree and a large desired sample size
N this is the most efficient method.
Method “D2” calculates the joint distribution generated by the tree without
false positives/negatives, samples from it, and then ‘corrupts’ the
resulting sample. If
with.errors=FALSE is used then this method is
equivalent to method “D1”.
A data set where each row is an independent observation.
1 2 3 4 5 6 7 8 9 10
data(ov.cgh) ov.tree <- oncotree.fit(ov.cgh) set.seed(7365) rd <- generate.data(200, ov.tree, with.errors=TRUE) #compare timing of methods system.time(generate.data(20, ov.tree, with.errors=TRUE, method="S")) system.time(generate.data(20, ov.tree, with.errors=TRUE, method="D1")) system.time(generate.data(20, ov.tree, with.errors=TRUE, method="D2"))