reassign_samples: Assign Samples to Subpopulations

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

According to the densities of the two components of the mixture model given in the metadata of the hetset object, each sample is assigned randomly to one of the two components and thereby subpopulations are formed.

Usage

1

Arguments

H

hetset object with set of parameters as returned by scan_hetset

Details

Each sample is assigned to one of the two components of a normal mixture model. The probability for a sample x to be assigned to subpopulation A is given by the relative density p_A = d(x|theta_A) / (d(x|theta_A)+d(x|theta_B)).

Note that deterministically assigning samples to the component with the higher density or the higher posterior (in a Bayes setting, when considering the mixture-parameter) leads to an overestimation of the distance of the centers of the two densities. Particularly in a setting, where overlapping distributions are expected, this bias should be avoided.

Value

hetset object with updated H$prt-entry

Author(s)

Daniel Samaga

References

Alan Genz, Frank Bretz, Tetsuhisa Miwa, Xuefei Mi, Friedrich Leisch, Fabian Scheipl, Torsten Hothorn (2018). mvtnorm: Multivariate Normal and t Distributions. R package version 1.0-8. URL http://CRAN.R-project.org/package=mvtnorm

Alan Genz, Frank Bretz (2009), Computation of Multivariate Normal and t Probabilities. Lecture Notes in Statistics, Vol. 195., Springer-Verlag, Heidelberg. ISBN 978-3-642-01688-2

See Also

scan_hetset, estimate_densities

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
A <- matrix(data = rnorm(n = 1000,mean = 1,sd = 1),ncol = 40)
Hds <- hetset(D = A)
Hds$prt <- as.factor(rep(c("A","B"),times = 20))
Hds@metadata$slf <- c("F5","F15")
Hds <- estimate_densities(Hds)
Hds@metadata$color_type <- "subpop"
plot_hetset(Hds)
Hds <- reassign_samples(Hds)
plot_hetset(Hds)

data("TCGA_HNSCC_expr")
Hds@metadata$slf <- sample(Hds@NAMES,3,FALSE)
Hds$prt <- as.factor(sample(c("A","B"),ncol(Hds),TRUE))
Hds <- censor_data(Hds)
Hds@metadata$color_type <- "subpop"
Hds <- estimate_densities(Hds)
plot_hetset(Hds)
Hds <- reassign_samples(Hds)
plot_hetset(Hds)

ZytoHMGU/hetset documentation built on June 6, 2019, 2:16 p.m.