50% off: Unlimited data and AI learning.
The Learning Leader's Guide to AI Literacy

bayesmeta (version 2.3)

dhalflogistic: Half-logistic distribution.

Description

Half-logistic density, distribution, quantile functions and random number generation.

Usage

dhalflogistic(x, scale=1, log=FALSE)
  phalflogistic(q, scale=1)
  qhalflogistic(p, scale=1)
  rhalflogistic(n, scale=1)

Arguments

x, q

quantile.

p

probability.

n

number of observations.

scale

scale parameter (>0).

log

logical; if TRUE, logarithmic density will be returned.

Value

dhalflogistic()’ gives the density function, ‘phalflogistic()’ gives the cumulative distribution function (CDF), ‘qhalflogistic()’ gives the quantile function (inverse CDF), and ‘rhalflogistic()’ generates random deviates.

Details

The half-logistic distribution is simply a zero-mean logistic distribution that is restricted to take only positive values. If Xlogistic, then |sX|halflogistic(scale=s).

References

N.L. Johnson, S. Kotz, N. Balakrishnan. Continuous univariate distributions, volume 2, chapter 23.11. Wiley, New York, 2nd edition, 1994.

See Also

dlogis, dhalfnormal, dlomax, drayleigh, TurnerEtAlPrior, RhodesEtAlPrior, bayesmeta.

Examples

Run this code
# NOT RUN {
#######################
# illustrate densities:
x <- seq(0,6,le=200)
plot(x, dhalfnormal(x), type="l", col="red", ylim=c(0,1),
     xlab=expression(tau), ylab=expression("probability density "*f(tau)))
lines(x, dhalflogistic(x), col="green3")
lines(x, dhalfcauchy(x), col="blue")
lines(x, dexp(x), col="cyan")
abline(h=0, v=0, col="grey")

# show log-densities (note the differing tail behaviour):
plot(x, dhalfnormal(x), type="l", col="red", ylim=c(0.001,1), log="y",
     xlab=expression(tau), ylab=expression("probability density "*f(tau)))
lines(x, dhalflogistic(x), col="green3")
lines(x, dhalfcauchy(x), col="blue")
lines(x, dexp(x), col="cyan")
abline(v=0, col="grey")
# }

Run the code above in your browser using DataLab