taylor: Plot relationship between row mean and row variance

View source: R/taylor.R

taylorR Documentation

Plot relationship between row mean and row variance

Description

The power law relationship between variance and mean is known as Taylor's law, which is defined as: var(Y) = a*mean(Y)^b. We can obtain the power as the slope in log-scale: log(var(Y)) = log(a)+b*log(mean(Y))

Usage

taylor(x, type = "taylor", boot = 0, interval = "prediction",
  lower.conf = 0.025, upper.conf = 0.975, pseudo = 0,
  col = "black", header = "", label = FALSE, plot = TRUE)

Arguments

x

a matrix, mean and variance are computed row-wise

type

the type of plot to do: mean.var (mean vs variance), boxplot (row-wise), taylor (powerlaw fitted to mean vs variance)

boot

compute confidence interval for individual data points through bootstrapping with given number of iterations (only for type=taylor)

interval

compute prediction or confidence interval (for type=taylor)

lower.conf

lower limit of confidence interval for both regression line and individual data points (for type=taylor)

upper.conf

upper limit of confidence interval for both regression line and individual data points (for type=taylor)

pseudo

add a pseudo count to deal with zeros in log-log plot (for type=taylor)

col

the color of the dots

header

header string

label

label points interactively (only for type=taylor, escape to stop labeling)

plot

whether to display the plot

Details

For plot type taylor, confidence intervals for individual data points are estimated by first resampling columns with replacement from the input matrix and then recomputing log means and log variances on the bootstrapped data. The confidence interval shown for the regression line is the prediction interval.

Value

for type taylor, the slope, p-value, adjusted R2 of the Taylor law as well as the log means and variances and for boot>0, the lower and upper values of log mean and variance bootstraps are returned (slope, pval, adjR2, logmeans, logvars, lowerConfMean, upperConfMean, lowerConfVar, upperConfVar)

References

L.R. Taylor (1961). Aggregation, variance and the mean. Nature 189, 732-735.


hallucigenia-sparsa/seqtime documentation built on Jan. 9, 2023, 11:53 p.m.