Learn R Programming

VGAM (version 0.7-3)

cauchy1: Cauchy Distribution Family Function

Description

Estimates the location parameter of the Cauchy distribution by maximum likelihood estimation.

Usage

cauchy1(scale.arg=1, llocation="identity",
        elocation=list(), ilocation=NULL, method.init=1)

Arguments

scale.arg
Known (positive) scale parameter, called $s$ below.
llocation
Parameter link function for the $a$ location parameter. See Links for more choices.
elocation
List. Extra argument for the link. See earg in Links for general information.
ilocation
Optional initial value for $a$. By default, an initial value is chosen internally.
method.init
Integer, either 1 or 2 or 3. Initial method, three algorithms are implemented. Choose the another value if convergence fails, or use ilocation.

Value

Details

The Cauchy distribution has a density function $$f(y;a,s) = \left{ \pi s [1 + ((y-a)/s)^2] \right}^{-1}$$ where $y$ and $a$ are real and finite, and $s>0$. The distribution is symmetric about $a$ and has a heavy tail. Its median and mode are $a$, but the mean does not exist, therefore the fitted values are all NAs. Fisher scoring is used.

References

Evans, M., Hastings, N. and Peacock, B. (2000) Statistical Distributions, New York: Wiley-Interscience, Third edition.

See Also

Cauchy, cauchit.

Examples

Run this code
set.seed(123)
n = 500
x = runif(n)

y = rcauchy(n, loc=1+5*x, scale=.4)
fit = vglm(y ~ x, cauchy1(scale=0.4), trace =TRUE, crit="c")
coef(fit, matrix=TRUE)

y = rcauchy(n, loc=exp(1+0.5*x), scale=.4)
hist(y)
fit = vglm(y ~ x, cauchy1(scale=0.4, lloc="loge"), trace=TRUE, crit="c")
coef(fit, matrix=TRUE)
fitted(fit)[1:4]
summary(fit)

Run the code above in your browser using DataLab