drexp: The Refractory Exponential Distribution

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

View source: R/durationDist.R

Description

Density, distribution function, quantile function, and random generation for the refractory exponential.

Usage

1
2
3
4
drexp(x, rate = 10, rp = 0.005, log = FALSE)
prexp(q, rate = 10, rp = 0.005, lower.tail = TRUE, log.p = FALSE)
qrexp(p, rate = 10, rp = 0.005, lower.tail = TRUE, log.p = FALSE)
rrexp(n, rate = 10, rp = 0.005)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

lower.tail

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

log, log.p

logical; if TRUE, probabilities p are given as log(p).

rate

rate parameter (non-negative numeric).

rp

refractory period parameter (non-negative numeric).

Details

The refractory exponential distribution with rate, r, and refractory period, rp, has density:

f(x) = r exp(- r (x-rp))

for x >= rp.

Value

drexp gives the density, prexp gives the distribution function, qrexp gives the quantile function and rrexp generates random deviates.

Author(s)

Christophe Pouzat christophe.pouzat@gmail.com

References

Johnson, D. H. and Swami, A. (1983) The transmission of signals by auditory-nerve fiber discharge patterns. J. Acoust. Soc. Am. 74: 493–501.

See Also

rexpMLE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Not run: 
tSeq <- seq(0.001,0.6,0.001)
rate.true <- 20
rp.true <- 0.01
Yd <- drexp(tSeq, rate.true, rp.true)
Yh <- hrexp(tSeq, rate.true, rp.true)
max.Yd <- max(Yd)
max.Yh <- max(Yh)
Yd <- Yd / max.Yd
Yh <- Yh / max.Yh
oldpar <- par(mar=c(5,4,4,4))
plot(tSeq, Yd, type="n", axes=FALSE, ann=FALSE,
     xlim=c(0,0.6), ylim=c(0,1))
axis(2,at=seq(0,1,0.2),labels=round(seq(0,1,0.2)*max.Yd,digits=2))
mtext("Density (1/s)", side=2, line=3)
axis(1,at=pretty(c(0,0.6)))
mtext("Time (s)", side=1, line=3)
axis(4, at=seq(0,1,0.2), labels=round(seq(0,1,0.2)*max.Yh,digits=2))
mtext("Hazard (1/s)", side=4, line=3, col=2)
mtext("Refractory Exponential Density and Hazard Functions", side=3, line=2,cex=1.5)
lines(tSeq,Yd)
lines(tSeq,Yh,col=2)
par(oldpar)

## End(Not run)

STAR documentation built on May 2, 2019, 11:44 a.m.