lsigma
,
isigma
, nsimEI
, parallel
and zero
.TypicalVGAMfamilyFunction(lsigma = "loge", esigma = list(), isigma = NULL,
parallel = TRUE, shrinkage.init = 0.95,
nointercept = NULL, method.init = 1,
nsimEIM = 100, zero = NULL)
Links
for a selection of choices.
If there is only one parameter then this argument is often called
link
.Links
for more information.
If there is only one parameter then this argument is often called
earg<
"i"
.
For example, "isigma"
and "ilocation"
, or just
"init"
if there is one parameter.
A value of NULL
mcumulative
,
nsimEIM
argument specifies the number
of random variates used per observation; the mean of nsi
1
or 2
or 3
or ... which
specifies the initialization method for some parameters or a specific
parameter.
If failure to converge occurs try the next higher value, and
continue until succzero
is specified then it is a vector with valuNULL
means no such constraints."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
and vgam
.zero
argument is supplied for convenience but conflicts
can arise with other arguments, e.g., the constraints
argument of vglm
and vgam
.
See Example 5 below for an example.
If not sure, use, e.g., constraints(fit)
and
coef(fit, matrix=TRUE)
to check the result of a fit fit
.
The arguments zero
and nointercept
can be inputted
with values that fail. For example,
multinomial(zero = 2, nointercept = 1:3)
means the
second linear/additive predictor is identically zero,
which will cause a failure.
Be careful about the use of other potentially contradictory constraints,
e.g., multinomial(zero = 2, parallel = TRUE ~ x3)
. If in doubt,
apply constraints()
to the fitted object to check.
nsimEIM
may have inaccurate
working weight matrices. If so, then the standard errors of the
regression coefficients may be inaccurate. Thus output from
summary(fit)
,
vcov(fit)
,
etc. may be misleading.
Links
,
vglmff-class
.# Example 1
cumulative()
cumulative(link="probit", reverse=TRUE, parallel=TRUE)
# Example 2
x = runif(n <- 1000)
y = rweibull(n, shape=2+exp(1+x), scale = exp(-0.5))
fit = vglm(y ~ x, weibull(lshape="logoff", eshape=list(offset=-2), zero=2))
coef(fit, mat=TRUE)
Coef(fit)
# Example 3
x = runif(n <- 500)
y1 = rnbinom(n, mu=exp(3+x), size=exp(1)) # k is size
y2 = rnbinom(n, mu=exp(2-x), size=exp(0))
fit = vglm(cbind(y1,y2) ~ x, negbinomial(zero=-2)) # multivariate response
coef(fit, matrix=TRUE)
# Example 4
# fit1 and fit2 are equivalent
fit1 = vglm(ymatrix ~ x2 + x3 + x4 + x5,
cumulative(parallel=FALSE ~ 1 + x3 + x5), mydataframe)
fit2 = vglm(ymatrix ~ x2 + x3 + x4 + x5,
cumulative(parallel=TRUE ~ x2 + x4), mydataframe)
# Example 5
x = rnorm(n <- 200)
y1 = rnorm(n, mean=1-3*x, sd=exp(1+0.2*x))
y2 = rnorm(n, mean=1-3*x, sd=exp(1))
args(normal1)
fit1 = vglm(y1 ~ x, normal1) # This is ok
fit2 = vglm(y2 ~ x, normal1(zero=2)) # This is ok
# This creates potential conflict
clist = list("(Intercept)"=diag(2), "x"=diag(2))
fit3 = vglm(y2 ~ x, normal1(zero=2), constraints=clist) # Conflict!
coef(fit3, matrix=TRUE) # Shows that clist[["x"]] was overwritten,
constraints(fit3) # i.e., 'zero' seems to override the 'constraints' arg
Run the code above in your browser using DataLab