Half-t Distribution

Share:

Description

These functions provide the density, distribution function, quantile function, and random generation for the half-t distribution.

Usage

1
2
3
4
dhalft(x, scale=25, nu=1, log=FALSE)
phalft(q, scale=25, nu=1)
qhalft(p, scale=25, nu=1)
rhalft(n, scale=25, nu=1)

Arguments

x,q

These are each a vector of quantiles.

p

This is a vector of probabilities.

n

This is the number of observations, which must be a positive integer that has length 1.

scale

This is the scale parameter alpha, which must be positive.

nu

This is the scalar degrees of freedom parameter, which is usually represented as nu.

log

Logical. If log=TRUE then the logarithm of the density is returned.

Details

  • Application: Continuous Univariate

  • Density: p(theta) = (1 + (1/nu)*(theta/alpha)^2)^(-(nu+1)/2), theta >= 0

  • Inventor: Derived from the Student t

  • Notation 1: theta ~ HT(alpha,nu)

  • Notation 2: p(theta) = HT(theta | alpha,nu)

  • Parameter 1: scale parameter alpha > 0

  • Parameter 2: degrees of freedom parameter nu

  • Mean: E(theta) = unknown

  • Variance: var(theta) = unknown

  • Mode: mode(theta) = 0

The half-t distribution is derived from the Student t distribution, and is useful as a weakly informative prior distribution for a scale parameter. It is more adaptable than the default recommended half-Cauchy, though it may also be more difficult to estimate due to its additional degrees of freedom parameter, nu. When nu=1, the density is proportional to a proper half-Cauchy distribution. When nu=-1, the density becomes an improper, uniform prior distribution. For more information on propriety, see is.proper.

Wand et al. (2011) demonstrated that the half-t distribution may be represented as a scale mixture of inverse-gamma distributions. This representation is useful for conjugacy.

Value

dhalft gives the density, phalft gives the distribution function, qhalft gives the quantile function, and rhalft generates random deviates.

References

Wand, M.P., Ormerod, J.T., Padoan, S.A., and Fruhwirth, R. (2011). "Mean Field Variational Bayes for Elaborate Distributions". Bayesian Analysis, 6: p. 847–900.

See Also

dhalfcauchy, dst, dt, dunif, and is.proper.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(LaplacesDemon)
x <- dhalft(1,25,1)
x <- phalft(1,25,1)
x <- qhalft(0.5,25,1)
x <- rhalft(10,25,1)

#Plot Probability Functions
x <- seq(from=0.1, to=20, by=0.1)
plot(x, dhalft(x,1,-1), ylim=c(0,1), type="l", main="Probability Function",
     ylab="density", col="red")
lines(x, dhalft(x,1,0.5), type="l", col="green")
lines(x, dhalft(x,1,500), type="l", col="blue")
legend(2, 0.9, expression(paste(alpha==1, ", ", nu==-1),
     paste(alpha==1, ", ", nu==0.5), paste(alpha==1, ", ", nu==500)),
     lty=c(1,1,1), col=c("red","green","blue"))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.