Fragment Distribution {sonicLength}R Documentation

Simple Fragment Length Distribution

Description

Density, distribution function, quantile function and random generation for a simple parametric distribution for fragments lengths (given by conditioning a geometric distribution on whether the length can be recovered).

Usage

dfrag( x, loc=45, lscale=2.5, rate=0.02, maxx=qgeom(1-1e-7,rate) )
pfrag( q, loc=45, lscale=2.5, rate=0.02, maxx=qgeom(1-1e-7,rate), lower.tail=TRUE )
qfrag( p, loc=45, lscale=2.5, rate=0.02, maxx=qgeom(1-1e-7,rate), lower.tail=TRUE )
rfrag( n, loc=45, lscale=2.5, rate=0.02, maxx=qgeom(1-1e-7,rate) )
  

Arguments

x, q

vector of quantile (of lengths).

n

number of lengths to sample.

p

vector of probabilities

loc

vector of locations of logistic for prob of recovery.

lscale

vector of scales of logistic for prob of recovery.

rate

probability for geometric probability for fragment lengths.

maxx

integer; largest value of x to bother with.

lower.tail

logical; if TRUE (default), probabilities are P[X \le x] otherwise, P[X > x].

Details

The mass function is given by plogis(x,loc,lscale)*dgeom(x,rate) / denom , where denom scales the result to sum to 1.0 in the range 0:maxx. The other functions all depend on this in the obvious manner. If maxx is not large enough a warning may be issued, but even without this warning the results may be slightly innaccurate if pgeom(maxx,rate,lower.tail=FALSE) is non-negligible.

Value

dfrag gives the mass function, pfrag gives the distribution function, qfrag gives the quantile function, and rfrag generates random deviates.

Author(s)

Charles C. Berry ccberry@users.r-forge.r-project.org

See Also

pgeom, sample

Examples

  
  plot( 0:300, table(factor(rfrag(2000),0:300)) )
  lines( 0:300, 2000*dfrag(0:300) )
  
  

[Package sonicLength version 1.4.7 Index]