
Maximum likelihood estimation of the nine parameters of a trivariate normal distribution.
trinormal(zero = c("sd", "rho"), eq.mean = FALSE,
eq.sd = FALSE, eq.cor = FALSE,
lmean1 = "identitylink", lmean2 = "identitylink",
lmean3 = "identitylink",
lsd1 = "loge", lsd2 = "loge", lsd3 = "loge",
lrho12 = "rhobit", lrho23 = "rhobit", lrho13 = "rhobit",
imean1 = NULL, imean2 = NULL, imean3 = NULL,
isd1 = NULL, isd2 = NULL, isd3 = NULL,
irho12 = NULL, irho23 = NULL, irho13 = NULL, imethod = 1)
Link functions applied to the means and standard deviations.
See Links
for more choices.
Being positive quantities, a log link is the default for the
standard deviations.
Link functions applied to the correlation parameters.
See Links
for more choices.
By default the correlation parameters are allowed to have
a value between -1 and 1, but that may be problematic
when eq.cor = TRUE
because they should have a value
between -0.5 and 1.
See CommonVGAMffArguments
for more information.
See CommonVGAMffArguments
for more information.
Logical. Constrain the means or the standard deviations or correlation parameters to be equal?
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.
The default parameterization does not make the estimated
variance-covariance matrix positive-definite.
In order for the variance-covariance matrix to be positive-definite
the quantity
1 - rho12^2 - rho13^2 - rho23^2 + 2 * rho12 * rho13 * rho23
must be positive, and if eq.cor = TRUE
then
this means that the rho
s must be between -0.5 and 1.
For the trivariate 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 three-column matrix.
The three correlation parameters are prefixed by rho
,
and the default gives them values between
uninormal
,
binormal
,
rtrinorm
.
# NOT RUN {
set.seed(123); nn <- 1000
tdata <- data.frame(x2 = runif(nn), x3 = runif(nn))
tdata <- transform(tdata, y1 = rnorm(nn, 1 + 2 * x2),
y2 = rnorm(nn, 3 + 4 * x2),
y3 = rnorm(nn, 4 + 5 * x2))
fit1 <- vglm(cbind(y1, y2, y3) ~ x2, data = tdata,
trinormal(eq.sd = TRUE, eq.cor = TRUE), trace = TRUE)
coef(fit1, matrix = TRUE)
constraints(fit1)
summary(fit1)
# }
# NOT RUN {
# Try this when eq.sd = TRUE, eq.cor = TRUE:
fit2 <- vglm(cbind(y1, y2, y3) ~ x2, data = tdata, stepsize = 0.25,
trinormal(eq.sd = TRUE, eq.cor = TRUE,
lrho12 = extlogit(min = -0.5),
lrho23 = extlogit(min = -0.5),
lrho13 = extlogit(min = -0.5)), trace = TRUE)
coef(fit2, matrix = TRUE)
# }
Run the code above in your browser using DataLab