Computes moments of a Poisson distribution. The calculations are based on values of positive and total partitions or the theoretical lambda value.

moments(input)

Arguments

input
a vector with two elements (the first element is treated as a number of positive partitions and the second as a number of total partitions) or a matrix with two columns (first columns contains numbers of positive partitions and the second total numbers of total partitions) or an object of class dpcr .

Value

A data frame with four columns: name of the experiment, name of the replicate, method of computation (theoretical or empirical), name of the moment and the value of the moment. The theoretical moments are computed using the lambda value and the empirical using the sample values.

Note

Four first moments of a Poisson distribution.

Mean : \(\lambda\).

Variance: \(\lambda\).

Skewness: \(\sqrt{\lambda}\).

Kurtosis: \(\frac{1}{\lambda}\).

Examples

# moments for 100 positive partitions of 765 total partitions moments(c(100, 765))
#> experiment replicate method moment value #> 1 Unknown Unknown theoretical mean 0.1400888 #> 2 Unknown Unknown theoretical variance 0.1400888 #> 3 Unknown Unknown theoretical skewness 2.6717653 #> 4 Unknown Unknown theoretical kurtosis 7.1383298 #> 5 Unknown Unknown empirical mean 0.1307190 #> 6 Unknown Unknown empirical variance 0.1137802 #> 7 Unknown Unknown empirical skewness 2.1909760 #> 8 Unknown Unknown empirical kurtosis 2.8003759
# calculate moments for an array digital PCR moments(six_panels)
#> experiment replicate method moment value #> 1 Experiment1 1 theoretical mean 0.01315808 #> 2 Experiment1 1 theoretical variance 0.01315808 #> 3 Experiment1 1 theoretical skewness 8.71773500 #> 4 Experiment1 1 theoretical kurtosis 75.99890350 #> 5 Experiment1 1 empirical mean 0.01307190 #> 6 Experiment1 1 empirical variance 0.01291791 #> 7 Experiment1 1 empirical skewness 8.57398653 #> 8 Experiment1 1 empirical kurtosis 71.51324503 #> 9 Experiment1 2 theoretical mean 0.01183446 #> 10 Experiment1 2 theoretical variance 0.01183446 #> 11 Experiment1 2 theoretical skewness 9.19233451 #> 12 Experiment1 2 theoretical kurtosis 84.49901380 #> 13 Experiment1 2 empirical mean 0.01176471 #> 14 Experiment1 2 empirical variance 0.01164152 #> 15 Experiment1 2 empirical skewness 9.05604244 #> 16 Experiment1 2 empirical kurtosis 80.01190476 #> 17 Experiment2 1 theoretical mean 0.05508444 #> 18 Experiment2 1 theoretical variance 0.05508444 #> 19 Experiment2 1 theoretical skewness 4.26074482 #> 20 Experiment2 1 theoretical kurtosis 18.15394645 #> 21 Experiment2 1 empirical mean 0.05359477 #> 22 Experiment2 1 empirical variance 0.05078876 #> 23 Experiment2 1 empirical skewness 3.96423592 #> 24 Experiment2 1 empirical kurtosis 13.71516642 #> 25 Experiment2 2 theoretical mean 0.05094936 #> 26 Experiment2 2 theoretical variance 0.05094936 #> 27 Experiment2 2 theoretical skewness 4.43027464 #> 28 Experiment2 2 theoretical kurtosis 19.62733335 #> 29 Experiment2 2 empirical mean 0.04967320 #> 30 Experiment2 2 empirical variance 0.04726756 #> 31 Experiment2 2 empirical skewness 4.14534058 #> 32 Experiment2 2 empirical kurtosis 15.18384855 #> 33 Experiment3 1 theoretical mean 0.14612199 #> 34 Experiment3 1 theoretical variance 0.14612199 #> 35 Experiment3 1 theoretical skewness 2.61602690 #> 36 Experiment3 1 theoretical kurtosis 6.84359673 #> 37 Experiment3 1 empirical mean 0.13594771 #> 38 Experiment3 1 empirical variance 0.11761968 #> 39 Experiment3 1 empirical skewness 2.12440735 #> 40 Experiment3 1 empirical kurtosis 2.51310660 #> 41 Experiment3 2 theoretical mean 0.13409177 #> 42 Experiment3 2 theoretical variance 0.13409177 #> 43 Experiment3 2 theoretical skewness 2.73085683 #> 44 Experiment3 2 theoretical kurtosis 7.45757903 #> 45 Experiment3 2 empirical mean 0.12549020 #> 46 Experiment3 2 empirical variance 0.10988605 #> 47 Experiment3 2 empirical skewness 2.26102803 #> 48 Experiment3 2 empirical kurtosis 3.11224776