Distribution-based normalization
install.packages("devtools")
library("devtools")
install_github("mengqinxue/DBNorm")
PS: if lazy loading failed to install a required package "distr", "nls2" and "nlmrt", please install it manually before running DBNorm.
This library provides four example data arrays for testing purpose and they are DArray1 (22,277), DArray2 (22,277), DArray3 (54,675) and DArray4 (33,297).
These four example data arrays can be loaded via function data() or loadData().
This function loads build-in data arrays.
n - n-th data array to load; if n = 1, DArray1 is loaded; if n = 2, DArray2 is loaded; if n = 3, DArray3 is loaded; if n = 4, DArray4 is loaded; if n is not 1, 2, 3, 4, all four data arrays are loaded;
The function generates distributions data for downstream analysis, such as fitting and distribution plot.
######Params data - input data array
nbin - the number of bins for distributions. The more number of bins, the more accurate distribution fitting functions is.
######Return A distribution dataset of a given input data array
The function generates distribution data based on predefined distribution
######Params dist - a predefined distribution;
min - the lower bound of data range and default value is 0;
max - the upper bound of data range and default value is 1;
######Return A distribution dataset of the input predefined distribution
The function plots distributions of distribution data which is generated by genDistData()
######Params DBdata - distribution data
type - plot by frequence / probability
t - title of plot
xl - description of x-asis
yl - description of y-asis
The function fits distributions by polynomial curve fitting and returns a polynomial curve fitting function.
DBdata - distribution data
n - the degree of polynomial functions
A polynomial curve fitting function
The function fits distributions by fourier curve fitting and returns a fourier curve fitting function.
DBdata - distribution data
n - the degree of the fourier fitting function
A fourier curve fitting function
The function fits distributions by gaussian curve fitting and returns a gaussian curve fitting function.
DBdata - distribution data
A gaussian curve fitting function
The function fits distributions by a customised curve fitting and returns a customised curve fitting function.
DBdata - distribution data
formula - a customised fitting formula
A customised curve fitting function
The function visualizes data distribution and corresponding fitting function so as to provide an intutive way to evaluate the performance of fitting function.
DBdata - distribution data
t - title of plot
xl - description of x-asis
yl - description of y-asis
The function normalizes a target data array to a basis array based on their distributions and the basis data array can be an arbitary data array or a standard distribution such as normal distribution.
tg - a target data array
bs - a basis data array
A normalized target data array with the same distribution with the basis data array
The function normalize target data array to a basis array based on element positions. This method does not need to do fitting before normalization and works for discrete values as well.
tg - a target data array
bs - a basis data array
A normalized target data array with the same distribution with the basis data array
The function normalize target data array to a standard distribution.
tg - a target data array
bs - a standard distribution created by defineDist(dist)
A normalized target data array with the same distribution with the basis data array