Learn R Programming

DNAprofiles (version 0.3.1)

dist.pair.cdf: CDF of product of a pair of distributions (one cumulative)

Description

CDF of product of a pair of distributions (one cumulative)

Usage

dist.pair.cdf(pair)

Arguments

pair
a list with named sublists:
  • cumdist1: a list with vectors x, Fx
  • dist2: a list with vectors x, fx

Value

function

Details

TODO

Examples

Run this code
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)")

Run the code above in your browser using DataLab