Learn R Programming

VGAM (version 1.1-12)

chisq: Chi-squared and Chi Distributions

Description

Maximum likelihood estimation of the degrees of freedom for a chi-squared distribution. Also fits the chi distribution.

Usage

chisq(link = "loglink", zero = NULL, squared = TRUE)

Value

An object of class "vglmff"

(see vglmff-class). The object is used by modelling functions such as vglm, and vgam.

Arguments

link, zero

See CommonVGAMffArguments for information.

squared

Logical. Set FALSE for the chi distribution.

Author

T. W. Yee

Details

The degrees of freedom is treated as a real parameter to be estimated and not as an integer. Being positive, a log link is used by default. Fisher scoring is used.

If a random variable has a chi-squared distribution then the square root of the random variable has a chi distribution. For both distributions, the fitted value is the mean.

References

Forbes, C., Evans, M., Hastings, N. and Peacock, B. (2011). Statistical Distributions, Hoboken, NJ, USA: John Wiley and Sons, Fourth edition.

See Also

Chisquare. uninormal.

Examples

Run this code
cdata <- data.frame(x2 = runif(nn <- 1000))
cdata <- transform(cdata, y1 = rchisq(nn, df = exp(1 - 1 * x2)),
                          y2 = rchisq(nn, df = exp(2 - 2 * x2)))
fit <- vglm(cbind(y1, y2) ~ x2, chisq, data = cdata, trace = TRUE)
coef(fit, matrix = TRUE)

Run the code above in your browser using DataLab