Description Usage Arguments Value Examples

Distribution of product of several discrete random variables as product X*Y

1 2 | ```
dists.product.pair(dists, n.max = 1e+06, appr = FALSE, appr.method = 1L,
n.max.appr = 1000, r0 = 0.01, R = 1.05)
``` |

`dists` |
a list of distributions |

`n.max` |
maximum number of mass points of discrete distribution used in the process |

`appr` |
if TRUE, then the distributions are shrunken (approximated), if necessary, to not exceed n.max |

`appr.method` |
integer: 1 (merge mass points to lower bound); 2 (merge to upper bound) |

`n.max.appr` |
maximum number of mass points of shrunken distributions |

`r0` |
numeric, relative tolerance used in first step of shrinking the distributions |

`R` |
numeric, |

list with named sublists:

cumdist1: a list with vectors

`x`

,`Fx`

dist2: a list with vectors

`x`

,`fx`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
data(freqsNLngm)
set.seed(123)
x <- sample.profiles(1,freqsNLngm)
# per locus distribution of kinship index
dists <- ki.dist(x,hyp.1="FS",hyp.2="UN",hyp.true="UN")
n <- sapply(dists,function(x) length(x$fx))
prod(n) # too many outcomes to store!
# but, for two subsets of the loci, the distribution can be obtained
pair <- dists.product.pair(dists)
str(pair) # with these, we can compute exceedance probabilities quickly
# obtain the cdf as a function
cdf <- dist.pair.cdf(pair)
cdf(1)
# plot the cdf
x0 <- seq(from=-10,to=5,length=50)
plot(x0,cdf(10^x0),type="l",xlab="x",ylab="Fn(x)")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.