NumericUtilities: Numeric Utilities

NumericUtilitiesR Documentation

Numeric Utilities

Description

A set of function helper related to the statistical model underlying the COTAN package

Usage

funProbZero(dispersion, mu)

dispersionBisection(
  sumZeros,
  lambda,
  nu,
  threshold = 0.001,
  maxIterations = 100L
)

parallelDispersionBisection(
  genes,
  sumZeros,
  lambda,
  nu,
  threshold = 0.001,
  maxIterations = 100L
)

nuBisection(
  sumZeros,
  lambda,
  dispersion,
  initialGuess,
  threshold = 0.001,
  maxIterations = 100L
)

parallelNuBisection(
  cells,
  sumZeros,
  lambda,
  dispersion,
  initialGuess,
  threshold = 0.001,
  maxIterations = 100L
)

calcDist(data, method, diag = FALSE, upper = FALSE)

Arguments

dispersion

the estimated dispersion (a n-sized vector)

mu

the lambda times nu values (a n \times m matrix)

sumZeros

the number of genes not expressed in the relevant cell (a m-sized vector)

lambda

the estimated lambda (a n-sized vector)

nu

the estimated nu (a m-sized vector)

threshold

minimal solution precision

maxIterations

max number of iterations (avoids infinite loops)

genes

names of the relevant genes

initialGuess

the initial guess for nu (a m-sized vector)

cells

names of the relevant cells

data

a matrix or a data.frame of which we want to calculate the distance between columns

method

type of distance to use. Can be chosen among those supported by parallelDist::parDist()

diag

logical value indicating whether the diagonal of the distance matrix should be printed by print.dist.upper

upper

logical value indicating whether the upper triangle of the distance matrix should be printed by print.dist

Details

funProbZero is a private function that gives the probability that a sample gene's reads are zero, given the dispersion and mu parameters.

Using d for disp and \mu for mu, it returns: (1 + d \mu)^{-\frac{1}{d}} when d > 0 and \exp{((d - 1) \mu)} otherwise. The function is continuous in d = 0, increasing in d and decreasing in \mu. It returns 0 when d = -\infty or \mu = \infty. It returns 1 when \mu = 0.

dispersionBisection is a private function for the estimation of dispersion slot of a COTAN object via a bisection solver

The goal is to find a dispersion value that reduces to zero the difference between the number of estimated and counted zeros

parallelDispersionBisection is a private function invoked by estimateDispersionBisection() for the estimation of the dispersion slot of a COTAN object via a parallel bisection solver

The goal is to find a dispersion array that reduces to zero the difference between the number of estimated and counted zeros

nuBisection is a private function for the estimation of nu slot of a COTAN object via a bisection solver

The goal is to find a nu value that reduces to zero the difference between the number of estimated and counted zeros

parallelNuBisection is a private function invoked by estimateNuBisection() for the estimation of nu slot of a COTAN object via a parallel bisection solver

The goal is to find a nu array that reduces to zero the difference between the number of estimated and counted zeros

calcDist is a wrapper function that invokes parallelDist::parDist(): the main goal is to recover and finish the calculations via a fallback when there is a problem with the main algorithm

Value

the probability matrix that a read count is identically zero

the dispersion value

the dispersion values

the nu value

the dispersion values

a dist object with all distances


seriph78/COTAN documentation built on June 1, 2025, 4:57 p.m.