Learn R Programming

VGAM (version 0.8-7)

binormal: Bivariate normal distribution

Description

Maximum likelihood estimation of the five parameters of a bivariate normal distribution.

Usage

binormal(lmean1 = "identity", emean1 = list(),
         lmean2 = "identity", emean2 = list(),
         lsd1   = "loge",     esd1   = list(),
         lsd2   = "loge",     esd2   = list(),
         lrho   = "rhobit",   erho   = list(),
         imean1 = NULL,       imean2 = NULL,
         isd1   = NULL,       isd2   = NULL,
         irho   = NULL,       imethod = 1,
         equalmean = FALSE,   equalsd = FALSE,
         zero = 3:5)

Arguments

lmean1, lmean2, lsd1, lsd2, lrho
Link functions applied to the means, standard deviations and rho parameters. See Links for more choices. Being positive quantities, a log link is the default for the standard deviations.
emean1, emean2, esd1, esd2, erho
List. Extra argument for the links. See earg in Links for general information.
imean1, imean2, isd1, isd2, irho, imethod, zero
See CommonVGAMffArguments for more information.
equalmean, equalsd
Logical or formula. Constrains the means or the standard deviations to be equal. Only one of these arguments may be assigned a value.

Value

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

Details

For the bivariate normal distribution, this fits a linear model (LM) to the means, and by default, the other parameters are intercept-only. The response should be a two-column matrix. The correlation parameter is rho, which lies between $-1$ and $1$ (thus the rhobit link is a reasonable choice). The fitted means are returned as the fitted values, which is in the form of a two-column matrix. Fisher scoring is implemented.

See Also

normal1, gaussianff.

Examples

Run this code
nn <- 1000
mydat = data.frame(x2 = runif(nn), x3 = runif(nn))
mydat = transform(mydat, y1 = rnorm(nn, 1 + 2*x2),
                         y2 = rnorm(nn, 3 + 4*x2))
fit1 = vglm(cbind(y1, y2) ~ x2,
            binormal(equalsd = TRUE), data = mydat, trace = TRUE)
coef(fit1, matrix = TRUE)
constraints(fit1)
summary(fit1)

Run the code above in your browser using DataLab