Half-normal, half-Student-t and half-Cauchy density, distribution, quantile functions, random number generation, and expectation and variance.
dhalfnormal(x, scale=1, log=FALSE)
phalfnormal(q, scale=1)
qhalfnormal(p, scale=1)
rhalfnormal(n, scale=1)
ehalfnormal(scale=1)
vhalfnormal(scale=1) dhalft(x, df, scale=1, log=FALSE)
phalft(q, df, scale=1)
qhalft(p, df, scale=1)
rhalft(n, df, scale=1)
ehalft(df, scale=1)
vhalft(df, scale=1)
dhalfcauchy(x, scale=1, log=FALSE)
phalfcauchy(q, scale=1)
qhalfcauchy(p, scale=1)
rhalfcauchy(n, scale=1)
ehalfcauchy(scale=1)
vhalfcauchy(scale=1)
quantile.
probability.
number of observations.
scale parameter (
degrees-of-freedom parameter (
logical; if TRUE
, logarithmic density will be returned.
‘dhalfnormal()
’ gives the density function,
‘phalfnormal()
’ gives the cumulative distribution
function (CDF),
‘qhalfnormal()
’ gives the quantile function (inverse CDF),
and ‘rhalfnormal()
’ generates random deviates.
The ‘ehalfnormal()
’ and ‘vhalfnormal()
’
functions return the corresponding half-normal distribution's
expectation and variance, respectively.
For the
‘dhalft()
’, ‘dhalfcauchy()
’ and related
function it works analogously.
The half-normal distribution is simply a zero-mean normal distribution
that is restricted to take only positive values. The scale
parameter df
degrees-of-freedom,
and the half-Cauchy distribution is again a special case of the
half-t distribution with df=1
degrees of freedom.
Note that (half-) Student-t and Cauchy distributions arise as
continuous mixture distributions of (half-) normal
distributions. If
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.
A. Gelman. Prior distributions for variance parameters in hierarchical models. Bayesian Analysis, 1(3):515-534, 2006.
F. C. Leone, L. S. Nelson, R. B. Nottingham. The folded normal distribution. Technometrics, 3(4):543-550, 1961.
N. G. Polson, J. G. Scott. On the half-Cauchy prior for a global scale parameter. Bayesian Analysis, 7(4):887-902, 2012.
S. Psarakis, J. Panaretos. The folded t distribution. Communications in Statistics - Theory and Methods, 19(7):2717-2734, 1990.
dnorm
, dt
, dcauchy
,
dlomax
, drayleigh
,
TurnerEtAlPrior
, RhodesEtAlPrior
,
bayesmeta
.
# 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, dhalft(x, df=3), col="green")
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, dhalft(x, df=3), col="green")
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