modality: Test Distribution For Modality

View source: R/modality.R

modalityR Documentation

Test Distribution For Modality

Description

Test the modality (gaussian) of a distribution. Default tests for uni-, bi- and tri- modalities (argument <modes> = 2:3).

Usage

modality(x, modes = 2:3, prob = 0.95, coverage = 0.8, size = 10, ...)

Arguments

x

a named numeric vector of cells/observations or a matrix of genes X cells (variables X observations). If the latter, the column means are first computed.

modes

the modes to test; a numeric value or a numeric vector of modes to test. e.g. to test just for bimodality, modes = 2. Default: 2:3

prob

a numeric value >= 0 and <= 1; the minimeanm posterior probability required for an observation to be assigned to a mode. Default: 0.95

coverage

the fraction of observations that meanst have a posterior probability higher than <prob> to one of two modes in order for the distribution to qualify as bimodal. Default: 0.8

size

the minimeanm number of observations that meanst be assigned to a mode in order for the distribution to qualify as bimodal. Default: 10

...

other arguments passed to fitBimodal

Value

vector of boolean values of length equal to length(modes) that were tested

Examples

x = c(rnorm(50, mean = 1), rnorm(50, mean = 10))
modality(x, modes = 2)
modality(x, modes = 2:3)

jlaffy/infercna documentation built on Jan. 26, 2024, 11:24 p.m.