show_partition: Consider Uncertainty of Partitioning

Description Usage Arguments Details Value Note Author(s) Examples

Description

Create a table of all samples showing their assignment to a subpopulation of the mixture model, restricted to a given level of plausibility.

Usage

1
show_partition(H, cutoff = 0.99, inner = 0.95)

Arguments

H

SummarizedExperiment data container with two component normal mixture fit as returned by scan_hetset

cutoff

minimum relative likelihood (i.e. chance of steeming from its associated component-density conditional on its observed value)

inner

quantile-threshold of the Mahalanobis distance of the samples their component-center

Details

Two component mixture model...

For each subpopulation 10^5 independent idenitically distributed random samples are generated and the Mahalanobis distance to the corresponding location of the distribution is calculated.

Samples with a Mahalanobis distance to both of the components of more than the inner-quantile are labelled as unclassified (i.e. 'NA').

For all other samples, both densities (one or the other component) are calculated and the ratio (higher to lower density) is determined. All samples with a ratio of at least the cutoff are assigned to their subpopulations. The rest is labelled as unclassified (i.e. 'NA').

Value

A data.frame with the sample ID, the assigned subpopulation, its distance to both of the component-centers, the density-ratio as well as the sample information is returned.

Note

The Mahalanobis distance is identical along some (hyper-) ellipsoids around the location of a (multivariate) normal denstiy. The orientation of those isolines corresponds to the correlation matrix of the random variable.

Author(s)

Daniel Samaga

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
X1 <- c(rnorm(50,0,1),rnorm(50,3,1))
X2 <- c(rnorm(50,0,1),rnorm(50,2,1))
X3 <- c(rnorm(50,0,1),rnorm(50,2,2))
X4 <- c(rnorm(50,0,1),rnorm(50,1,1))
X5 <- c(rnorm(50,0,1),rnorm(50,1,2))
A <- matrix(data = rnorm(n = 1000,mean = 0,sd = 1),ncol = 100)
Hds <- hetset(D = rbind(X1,X2,X3,X4,X5,A))
rm(A,X1,X2,X3,X4,X5)
Hds <- scan_hetset(H = Hds,level = "univariate",min_size = 3,
                   max_size = 4,rel_imp = 0,em_steps = 5)
sp_out <- show_partition(H = Hds,cutoff = 0.99,inner = 0.95)
sp_out$group

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