Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dist_cauchy

The Cauchy distribution


Description

[Maturing]

Usage

dist_cauchy(location, scale)

Arguments

location

location and scale parameters.

scale

location and scale parameters.

Details

The Cauchy distribution is the student's t distribution with one degree of freedom. The Cauchy distribution does not have a well defined mean or variance. Cauchy distributions often appear as priors in Bayesian contexts due to their heavy tails.

We recommend reading this documentation on https://pkg.mitchelloharawild.com/distributional/, where the math will render nicely.

In the following, let X be a Cauchy variable with mean location = x_0 and scale = γ.

Support: R, the set of all real numbers

Mean: Undefined.

Variance: Undefined.

Probability density function (p.d.f):

f(x) = 1 / (π γ (1 + ((x - x_0) / γ)^2)

Cumulative distribution function (c.d.f):

F(t) = arctan((t - x_0) / γ) / π + 1/2

Moment generating function (m.g.f):

Does not exist.

See Also

Examples

dist <- dist_cauchy(location = c(0, 0, 0, -2), scale = c(0.5, 1, 2, 1))

dist
mean(dist)
variance(dist)
skewness(dist)
kurtosis(dist)

generate(dist, 10)

density(dist, 2)
density(dist, 2, log = TRUE)

cdf(dist, 4)

quantile(dist, 0.7)

distributional

Vectorised Probability Distributions

v0.2.2
GPL-3
Authors
Mitchell O'Hara-Wild [aut, cre] (<https://orcid.org/0000-0001-6729-7695>), Earo Wang [ctb] (<https://orcid.org/0000-0001-6448-5260>), Matthew Kay [ctb] (<https://orcid.org/0000-0001-9446-0419>), Alex Hayes [aut] (<https://orcid.org/0000-0002-4985-5160>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.