dLiland: The distribution of distances between discrete events in...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/distribution.R

Description

Density, distribution function, quantile function and random generation for the Liland distribution with R trials and r successes.

Usage

1
2
3
4
dLiland(x, R, r, warn = FALSE)
pLiland(q, R, r, lower.tail = TRUE, warn = FALSE)
qLiland(p, R, r)
rLiland(n, R, r)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations.

R

number of trials.

r

number of successes.

warn

logical indicating if a warning should be issued if approximation is used.

lower.tail

logical indicating if the lower tail of the distribution should be summed.

Details

The Liland distribution has probability mass

f(X=x;R,r) = binomial(R-x|r-1)/binomial(R|r)

where x is the distance between consecutive successes, R is the number of trials and r is the number of successes.

Value

dLiland gives the probability mass, pLiland gives the distribution function, qLiland gives the quantile function, and rLiland generates random Liland values.

Author(s)

Kristian Hovde Liland

References

Liland, KH & Snipen, L, FixedTimeEvents: An R package for the distribution of distances between discrete events in fixed time, SoftwareX 5 (2016).

See Also

Liland, Liland.test, simLiland

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
dLiland(19, R = 1949, r = 162)
pLiland(19, R = 1949, r = 162)
qLiland(0.5, R = 1949, r = 162)
plot( pLiland(1:100, R = 1949, r = 162) )

## QQ-plot of Liland distribution and random Liland values
R <- 2000
r <- 120
n <- 1000
samp <- rLiland(n,R,r)
theo <- qLiland(ppoints(n),R,r)
qqplot(theo,samp,
       xlab='F(x;2000,120)', ylab='Sample (1000)', axes=FALSE)
axis(1,at=c(0,40,80,120))
axis(2,at=c(0,40,80,120))
box()
qqline(samp, distribution = function(p)qLiland(p,R=2000,r=120), col='gray',lty=2)

fixedTimeEvents documentation built on Jan. 4, 2022, 5:09 p.m.