chisq: Chi-squared Distribution

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/family.univariate.R

Description

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

Usage

1
chisq(link = "loglink", zero = NULL)

Arguments

link, zero

See CommonVGAMffArguments for information.

Details

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

Value

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

Note

Multiple responses are permitted. There may be convergence problems if the degrees of freedom is very large or close to zero.

Author(s)

T. W. Yee

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

1
2
3
4
5
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)

Example output

Loading required package: stats4
Loading required package: splines
VGLM    linear loop  1 :  loglikelihood = -3389.5166
VGLM    linear loop  2 :  loglikelihood = -3275.6358
VGLM    linear loop  3 :  loglikelihood = -3275.4909
VGLM    linear loop  4 :  loglikelihood = -3275.4909
             loge(df1) loge(df2)
(Intercept)  0.9539312  1.991984
x2          -0.9403747 -2.051279

VGAM documentation built on Jan. 16, 2021, 5:21 p.m.