# Cauchy: Create a Cauchy distribution In distributions3: Probability Distributions as S3 Objects

 Cauchy R Documentation

## Create a Cauchy distribution

### Description

Note that 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.

### Usage

```Cauchy(location = 0, scale = 1)
```

### Arguments

 `location` The location parameter. Can be any real number. Defaults to `0`. `scale` The scale parameter. Must be greater than zero (?). Defaults to `1`.

### Details

We recommend reading this documentation on https://alexpghayes.github.io/distributions3/, where the math will render with additional detail and much greater clarity.

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.

### Value

A `Cauchy` object.

Other continuous distributions: `Beta()`, `ChiSquare()`, `Erlang()`, `Exponential()`, `FisherF()`, `Frechet()`, `GEV()`, `GP()`, `Gamma()`, `Gumbel()`, `LogNormal()`, `Logistic()`, `Normal()`, `RevWeibull()`, `StudentsT()`, `Tukey()`, `Uniform()`, `Weibull()`

### Examples

```
set.seed(27)

X <- Cauchy(10, 0.2)
X

mean(X)
variance(X)
skewness(X)
kurtosis(X)

random(X, 10)

pdf(X, 2)
log_pdf(X, 2)

cdf(X, 2)
quantile(X, 0.7)

cdf(X, quantile(X, 0.7))
quantile(X, cdf(X, 7))
```

distributions3 documentation built on Sept. 7, 2022, 5:07 p.m.