N1binomial {VGAM} | R Documentation |
Linear Model and Binomial Mixed Data Type Family Function
Description
Estimate the four parameters of
the (bivariate) –binomial copula
mixed data type model
by maximum likelihood estimation.
Usage
N1binomial(lmean = "identitylink", lsd = "loglink",
lvar = "loglink", lprob = "logitlink", lapar = "rhobitlink",
zero = c(if (var.arg) "var" else "sd", "apar"),
nnodes = 20, copula = "gaussian", var.arg = FALSE,
imethod = 1, isd = NULL, iprob = NULL, iapar = NULL)
Arguments
lmean , lsd , lvar , lprob , lapar |
Details at |
imethod , isd , iprob , iapar |
Initial values.
Details at |
zero |
Details at |
nnodes |
Number of nodes and weights for the Gauss–Hermite (GH) quadrature. While a higher value should be more accurate, setting an excessive value runs the risk of evaluating some special functions near the boundary of the parameter space and producing numerical problems. |
copula |
Type of copula used. Currently only the bivariate normal is used but more might be implemented in the future. |
var.arg |
See |
Details
The bivariate response comprises
from the linear model having parameters
mean
and sd
for
and
,
and the binary
having parameter
prob
for its mean .
The
joint probability density/mass function is
and
where
adjusts
according to the association parameter
.
The quantity
is
.
The quantity
is
.
Thus there is an underlying bivariate normal
distribution, and a copula is used to bring the
two marginal distributions together.
Here,
, and
is the
cumulative distribution function
pnorm
of a standard univariate normal.
The first marginal
distribution is a normal distribution
for the linear model.
The second column of the response must
have values 0 or 1,
e.g.,
Bernoulli random variables.
When
then
.
Together, this family function combines
uninormal
and
binomialff
.
If the response are correlated then
a more efficient joint analysis
should result.
This VGAM family function cannot handle
multiple responses. Only a two-column
matrix is allowed.
The two-column fitted
value matrix has columns
and
.
Value
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions
such as vglm
and vgam
.
Note
This VGAM family function is fragile.
Because the EIMs are approximated by
GH quadrature it is found that convergence
may be a little slower than for other models
whose EIM is tractable.
Also, the log-likelihood may be flat at the MLE
with respect to especially
because the correlation
between the two mixed data types may be weak.
It pays to set trace = TRUE
to
monitor convergence, especially when
abs(apar)
is high.
Author(s)
T. W. Yee
References
Song, P. X.-K. (2007). Correlated Data Analysis: Modeling, Analytics, and Applications. Springer.
See Also
rN1binom
,
N1poisson
,
binormalcop
,
uninormal
,
binomialff
,
pnorm
.
Examples
nn <- 1000; mymu <- 1; sdev <- exp(1)
apar <- rhobitlink(0.5, inverse = TRUE)
prob <- logitlink(0.5, inverse = TRUE)
mat <- rN1binom(nn, mymu, sdev, prob, apar)
nbdata <- data.frame(y1 = mat[, 1], y2 = mat[, 2])
fit1 <- vglm(cbind(y1, y2) ~ 1, N1binomial,
nbdata, trace = TRUE)
coef(fit1, matrix = TRUE)
Coef(fit1)
head(fitted(fit1))
summary(fit1)
confint(fit1)