vglm
are set
using this function.vglm.control(backchat = if (is.R()) FALSE else TRUE,
checkwz=TRUE, criterion = names(.min.criterion.VGAM),
epsilon = 1e-07, half.stepsizing = TRUE,
maxit = 30, stepsize = 1, save.weight = FALSE,
trace = FALSE, wzepsilon = .Machine$double.eps^0.75,
xij = NULL, ...)
wzepsilon
. If not,
any values less than wzepsilon
are replaced wit.min.criterion.VGAM
, but
most family functions only implement a few of these.criterion
values are within
epsilon
of each other.weights
slot
of a "vglm"
object will be saved on the object. If not, it will
be reconstructed when needed, e.g., summary
.
Some family functions have save.weight=TRUE
control
slot of vglm
objects.vglm.fit
and
you will have to look at that to understand the full details. Setting save.weight=FALSE
is useful for some models because
the weights
slot of the object is the largest and so less
memory is used to store the object. However, for some save.weight=TRUE
because the weights
slot cannot be reconstructed later.
vglm
,
fill
.# Example 1.
data(pneumo)
pneumo = transform(pneumo, let=log(exposure.time))
vglm(cbind(normal,mild,severe) ~ let, multinomial, pneumo,
crit="coef", step=0.5, trace=TRUE, eps=1e-8, maxit=40)
# Example 2. The use of the xij argument
set.seed(111)
n = 1000
ymat = rdiric(n, shape=c(4,7,3,1))
mydat = data.frame(x1=runif(n), x2=runif(n), x3=runif(n), x4=runif(n),
z1=runif(n), z2=runif(n), z3=runif(n), z4=runif(n))
mydat = round(mydat, dig=2)
fit = vglm(ymat ~ x1 + x2 + x3 + x4 + z1 + z2 + z3 + z4,
fam = dirichlet, data=mydat, crit="c",
xij = list(z ~ z1 + z2 + z3 + z4,
x ~ x1 + x2 + x3 + x4))
model.matrix(fit, type="lm")[1:7,] # LM model matrix
model.matrix(fit, type="vlm")[1:7,] # Big VLM model matrix
coef(fit)
coef(fit, matrix=TRUE)
coef(fit, matrix=TRUE, compress=FALSE)
max(abs(predict(fit)-predict(fit, new=mydat))) # Predicts correctly
summary(fit)
Run the code above in your browser using DataLab