1% File src/library/stats/man/Cauchy.Rd 2% Part of the R package, https://www.R-project.org 3% Copyright 1995-2014 R Core Team 4% Distributed under GPL 2 or later 5 6\name{Cauchy} 7\alias{Cauchy} 8\alias{dcauchy} 9\alias{pcauchy} 10\alias{qcauchy} 11\alias{rcauchy} 12\title{The Cauchy Distribution} 13\description{ 14 Density, distribution function, quantile function and random 15 generation for the Cauchy distribution with location parameter 16 \code{location} and scale parameter \code{scale}. 17} 18\usage{ 19dcauchy(x, location = 0, scale = 1, log = FALSE) 20pcauchy(q, location = 0, scale = 1, lower.tail = TRUE, log.p = FALSE) 21qcauchy(p, location = 0, scale = 1, lower.tail = TRUE, log.p = FALSE) 22rcauchy(n, location = 0, scale = 1) 23} 24\arguments{ 25 \item{x, q}{vector of quantiles.} 26 \item{p}{vector of probabilities.} 27 \item{n}{number of observations. If \code{length(n) > 1}, the length 28 is taken to be the number required.} 29 \item{location, scale}{location and scale parameters.} 30 \item{log, log.p}{logical; if TRUE, probabilities p are given as log(p).} 31 \item{lower.tail}{logical; if TRUE (default), probabilities are 32 \eqn{P[X \le x]}, otherwise, \eqn{P[X > x]}.} 33} 34\value{ 35 \code{dcauchy}, \code{pcauchy}, and \code{qcauchy} are respectively 36 the density, distribution function and quantile function of the Cauchy 37 distribution. \code{rcauchy} generates random deviates from the 38 Cauchy. 39 40 The length of the result is determined by \code{n} for 41 \code{rcauchy}, and is the maximum of the lengths of the 42 numerical arguments for the other functions. 43 44 The numerical arguments other than \code{n} are recycled to the 45 length of the result. Only the first elements of the logical 46 arguments are used. 47} 48\details{ 49 If \code{location} or \code{scale} are not specified, they assume 50 the default values of \code{0} and \code{1} respectively. 51 52 The Cauchy distribution with location \eqn{l} and scale \eqn{s} has 53 density 54 \deqn{f(x) = \frac{1}{\pi s} 55 \left( 1 + \left(\frac{x - l}{s}\right)^2 \right)^{-1}% 56 }{f(x) = 1 / (\pi s (1 + ((x-l)/s)^2))} 57 for all \eqn{x}. 58} 59\source{ 60 \code{dcauchy}, \code{pcauchy} and \code{qcauchy} are all calculated 61 from numerically stable versions of the definitions. 62 63 \code{rcauchy} uses inversion. 64} 65\references{ 66 Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) 67 \emph{The New S Language}. 68 Wadsworth & Brooks/Cole. 69 70 Johnson, N. L., Kotz, S. and Balakrishnan, N. (1995) 71 \emph{Continuous Univariate Distributions}, volume 1, chapter 16. 72 Wiley, New York. 73} 74\seealso{ 75 \link{Distributions} for other standard distributions, including 76 \code{\link{dt}} for the t distribution which generalizes 77 \code{dcauchy(*, l = 0, s = 1)}. 78} 79\examples{ 80dcauchy(-1:4) 81} 82\keyword{distribution} 83