Learn R Programming

bayesmeta (version 2.6)

dhalflogistic: Half-logistic distribution.

Description

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

Usage

dhalflogistic(x, scale=1, log=FALSE)
  phalflogistic(q, scale=1)
  qhalflogistic(p, scale=1)
  rhalflogistic(n, scale=1)
  ehalflogistic(scale=1)
  vhalflogistic(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. The ‘ehalflogistic()’ and ‘vhalflogistic()’ functions return the corresponding half-logistic distribution's expectation and variance, respectively.

Details

The half-logistic distribution is simply a zero-mean logistic distribution that is restricted to take only positive values. If \(X\sim\mathrm{logistic}\), then \(|sX|\sim\mathrm{halflogistic}(\mathrm{scale}\!=\!s)\).

References

C. Roever, R. Bender, S. Dias, C.H. Schmid, H. Schmidli, S. Sturtz, S. Weber, T. Friede. On weakly informative prior distributions for the heterogeneity parameter in Bayesian random-effects meta-analysis. arXiv preprint 2007.08352 (submitted for publication), 2020.

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