1\name{CommonVGAMffArguments}
2\alias{CommonVGAMffArguments}
3\alias{TypicalVGAMfamilyFunction}
4\title{Common VGAM Family Function Arguments }
5\description{
6  Here is a description of some common and typical arguments found
7  in many \pkg{VGAM} family functions, e.g.,
8  \code{lsigma},
9  \code{isigma},
10  \code{gsigma},
11  \code{nsimEI},
12  \code{parallel} and
13  \code{zero}.
14
15}
16\usage{
17TypicalVGAMfamilyFunction(lsigma = "loglink",
18                          isigma = NULL,
19                          link.list = list("(Default)" = "identitylink",
20                                           x2          = "loglink",
21                                           x3          = "logofflink",
22                                           x4          = "multilogitlink",
23                                           x5          = "multilogitlink"),
24                          earg.list = list("(Default)" = list(),
25                                           x2          = list(),
26                                           x3          = list(offset = -1),
27                                           x4          = list(),
28                                           x5          = list()),
29                          gsigma = exp(-5:5),
30                          parallel = TRUE,
31                          ishrinkage = 0.95,
32                          nointercept = NULL, imethod = 1,
33                          type.fitted = c("mean", "quantiles", "Qlink",
34                                          "pobs0", "pstr0", "onempstr0"),
35                          percentiles = c(25, 50, 75),
36                          probs.x = c(0.15, 0.85),
37                          probs.y = c(0.25, 0.50, 0.75),
38                          multiple.responses = FALSE, earg.link = FALSE,
39                          whitespace = FALSE, bred = FALSE, lss = TRUE,
40                          oim = FALSE, nsimEIM = 100, byrow.arg = FALSE,
41                          zero = NULL)
42}
43\arguments{
44%                         apply.parint = FALSE,
45
46  \item{lsigma}{
47  Character.
48  Link function applied to a parameter and not necessarily a mean.
49  See \code{\link{Links}} for a selection of choices.
50  If there is only one parameter then this argument is often called
51  \code{link}.
52
53  }
54% \item{esigma}{
55% List.
56% Extra argument allowing for additional information, specific to the
57% link function.
58% See \code{\link{Links}} for more information.
59% If there is only one parameter then this argument is often called
60% \code{earg}.
61
62% }
63
64
65  \item{link.list, earg.list}{
66  Some \pkg{VGAM} family functions
67  (such as \code{\link{normal.vcm}})
68  implement models with
69  potentially lots of parameter link functions.
70  These two arguments allow many such links and extra arguments
71  to be inputted more easily.
72  One has something like
73  \code{link.list = list}
74\code{("(Default)" = "identitylink", x2 = "loglink", x3 = "logofflink")}
75  and
76  \code{earg.list = list}
77  \code{("(Default)" = list(), x2 = list(), x3 = "list(offset = -1)")}.
78  Then any unnamed terms will have the default link with its
79  corresponding extra argument.
80  Note: the \code{\link{multilogitlink}} link is also possible,
81  and if so, at least two instances of it are necessary.
82  Then the last term is the baseline/reference group.
83
84
85  }
86
87
88  \item{isigma}{
89  Optional initial values can often be inputted using an argument
90  beginning with \code{"i"}.
91  For example, \code{"isigma"} and \code{"ilocation"}, or just
92  \code{"init"} if there is one parameter.
93  A value of \code{NULL} means a value is computed internally, i.e.,
94  a \emph{self-starting} \pkg{VGAM} family function.
95  If a failure to converge occurs make use of these types of arguments.
96
97
98  }
99  \item{gsigma}{
100  Grid-search initial values can be inputted using an argument
101  beginning with \code{"g"},
102  e.g., \code{"gsigma"}, \code{"gshape"} and \code{"gscale"}.
103  If argument \code{isigma} is inputted then that has precedence over
104  \code{gsigma}, etc.
105% The actual search values will be \code{unique(sort(c(gshape)))}, etc.
106  If the grid search is 2-dimensional then it is advisable not to
107  make the vectors too long as a nested \code{for} loop may be used.
108  Ditto for 3-dimensions etc.
109  Sometimes a \code{".mux"} is added as a suffix, e.g., \code{gshape.mux};
110  this means that the grid is created relatively and not absolutely,
111  e.g., its values are multipled by some single initial estimate of the
112  parameter in order to create the grid on an absolute scale.
113
114
115
116  Some family functions have an argument called \code{gprobs.y}.
117  This is fed into the \code{probs}
118  argument of \code{\link[stats:quantile]{quantile}} in order to
119  obtain some values of central tendency of the response,
120  i.e., some spread of values in the middle.
121  when \code{imethod = 1} to obtain an initial value for the mean
122  Some family functions have an argument called \code{iprobs.y}, and
123  if so, then these values can overwrite \code{gprobs.y}.
124
125
126
127
128
129% Then the actual search values will be
130% \code{unique(sort(c(gshape, 1/gshape)))}, etc.
131
132
133  }
134  \item{parallel}{
135  A logical, or a simple formula specifying which terms have
136  equal/unequal
137  coefficients.
138  The formula must be simple, i.e.,
139  additive with simple main effects terms.
140  Interactions and nesting etc. are not handled.
141  To handle complex formulas use the \code{constraints} argument
142  (of \code{\link{vglm}} etc.);
143  however, there is a lot more setting up involved and things will
144  not be as convenient.
145
146
147  Here are some examples.
1481. \code{parallel = TRUE ~ x2 + x5} means the parallelism assumption
149is only applied to \eqn{X_2}, \eqn{X_5} and the intercept.
1502.  \code{parallel = TRUE ~ -1}
151and \code{parallel = TRUE ~ 0}
152mean the parallelism assumption
153is applied to \emph{no} variables at all.
154Similarly,
155\code{parallel = FALSE ~ -1} and
156\code{parallel = FALSE ~ 0}
157mean the parallelism assumption
158is applied to \emph{all} the variables including the intercept.
1593.  \code{parallel = FALSE ~ x2 - 1}
160and \code{parallel = FALSE ~ x2 + 0}
161applies the
162parallelism constraint to all terms (including the intercept)
163except for \eqn{X_2}.
164
165
166  This argument is common in \pkg{VGAM} family functions for categorical
167  responses, e.g., \code{\link{cumulative}},  \code{\link{acat}},
168  \code{\link{cratio}}, \code{\link{sratio}}.
169  For the proportional odds model (\code{\link{cumulative}}) having
170  parallel constraints applied to each explanatory variable (except for
171  the intercepts) means the fitted probabilities do not become negative
172  or greater than 1. However this parallelism or proportional-odds
173  assumption ought to be checked.
174
175
176  }
177
178
179% \item{apply.parint}{
180% \emph{This variable will be depreciated shortly}.
181% Logical.
182% It refers to whether the parallelism constraint is
183% applied to the intercept too.
184% By default, in some models it does, in other models it does not.
185% Used only if \code{parallel = TRUE} (fully or partially with
186% respect to all the explanatory variables).
187
188
189% }
190
191
192  \item{nsimEIM}{
193  Some \pkg{VGAM} family functions use simulation to obtain an
194  approximate
195  expected information matrix (EIM).
196  For those that do, the \code{nsimEIM} argument specifies the number
197  of random variates used per observation; the mean of \code{nsimEIM}
198  random variates is taken.
199  Thus \code{nsimEIM} controls the accuracy and a larger value may be
200  necessary if the EIMs are not positive-definite.
201  For intercept-only models (\code{y ~ 1)} the value of \code{nsimEIM}
202  can be smaller (since the common value used is also then taken as the
203  mean over the observations), especially if the number of observations
204  is large.
205
206
207  Some \pkg{VGAM} family functions provide two algorithms for estimating
208  the EIM.
209  If applicable, set \code{nsimEIM = NULL} to choose the other algorithm.
210
211
212  }
213  \item{imethod}{
214  An integer with value \code{1} or \code{2} or \code{3} or ... which
215  specifies the initialization method for some parameters or a specific
216  parameter.
217  If failure to converge occurs try the next higher value, and
218  continue until success.
219  For example, \code{imethod = 1} might be the method of moments,
220  and \code{imethod = 2} might be another method.
221  If no value of \code{imethod} works then it will be necessary
222  to use arguments such as \code{isigma}.
223  For many \pkg{VGAM} family functions it is advisable to try
224  this argument with all possible values to safeguard against
225  problems such as converging to a local solution.
226  \pkg{VGAM} family functions with this argument usually correspond
227  to a model or distribution that is relatively hard to fit successfully,
228  therefore care is needed to ensure the global solution is obtained.
229  So using all possible values that this argument supplies is a good idea.
230
231
232
233  \pkg{VGAM} family functions such \code{\link{genpoisson2}} recycle
234  \code{imethod} to be of length 2 corresponding to the 2
235  parameters. In the future, this feature will be extended to
236  other family functions to confer more flexibility.
237
238
239
240  }
241  \item{type.fitted}{
242  Character.
243  Type of fitted value returned by the \code{fitted()} methods function.
244  The first choice is always the default.
245  The available choices depends on what kind of family function it is.
246  Using the first few letters of the chosen choice is okay.
247  See \code{\link{fittedvlm}} for more details.
248
249
250
251  The choice \code{"Qlink"} refers to quantile-links, which was
252  introduced in December 2018 in \pkg{VGAMextra} 0.0-2 for
253  several 1-parameter distributions.
254  Here, either the
255  \code{\link{loglink}} or
256  \code{\link{logitlink}} or
257  \code{\link{identitylink}} of the quantile is the link function
258  (and the choice is dependent on the support of the distribution),
259  and link functions end in \code{"Qlink"}.
260  A limited amount of support is provided for such links,
261  e.g.,
262  \code{fitted(fit)} are the fitted quantiles, which is the same as
263  \code{predict(fit, type = "response")}.
264  However, \code{fitted(fit, percentiles = 77)} will not work.
265
266
267  }
268  \item{percentiles}{
269  Numeric vector, with values between 0 and 100
270  (although it is not recommended that exactly 0 or 100 be inputted).
271  Used only if \code{type.fitted = "quantiles"} or
272  \code{type.fitted = "percentiles"}, then
273  this argument specifies the values of these quantiles.
274  The argument name tries to reinforce that the values
275  lie between 0 and 100.
276  See \code{\link{fittedvlm}} for more details.
277
278
279  }
280  \item{probs.x, probs.y}{
281  Numeric, with values in (0, 1).
282  The probabilites that define quantiles with respect to some vector,
283  usually an \code{x} or \code{y} of some sort.
284  This is used to create two subsets of data corresponding to `low' and
285  `high' values of x or y.
286  Each value is separately fed into the \code{probs} argument
287  of \code{\link[stats:quantile]{quantile}}.
288  If the data set size is small then it may be necessary to
289  increase/decrease slightly the first/second values respectively.
290
291
292  }
293  \item{lss}{
294  Logical.
295  This stands for the ordering: location, scale and shape.
296  Should the ordering of the parameters be in this order?
297  Almost all \pkg{VGAM} family functions have this order by default,
298  but in order to match the arguments of existing R functions, one
299  might need to set \code{lss = FALSE}.
300  For example, the arguments of \code{\link{weibullR}} are
301  scale and shape, whereas \code{\link[stats]{rweibull}}
302  are shape and scale.
303  As a temporary measure
304  (from \pkg{VGAM} 0.9-7 onwards but prior to version 1.0-0),
305  some family functions such as \code{\link{sinmad}} have an
306  \code{lss} argument without a default. For these,
307  setting \code{lss = FALSE} will work.
308  Later, \code{lss = TRUE} will be the default.
309  Be careful for the \code{dpqr}-type functions, e.g.,
310  \code{\link{rsinmad}}.
311
312
313
314  }
315  \item{whitespace}{
316  Logical.
317  Should white spaces (\code{" "}) be used in the
318  labelling of the linear/additive predictors?
319  Setting \code{TRUE} usually results in more readability but
320  it occupies more columns of the output.
321
322
323  }
324  \item{oim}{
325  Logical.
326  Should the observed information matrices (OIMs) be used for
327  the working weights?
328  In general, setting \code{oim = TRUE} means the Newton-Raphson
329  algorithm, and \code{oim = FALSE} means Fisher-scoring.
330  The latter uses the EIM, and is usually recommended.
331  If \code{oim = TRUE} then \code{nsimEIM} is ignored.
332
333
334  }
335  \item{zero}{
336  Either an integer vector, or a vector of character strings.
337
338
339  If an integer, then it specifies which
340  linear/additive predictor is modelled as \emph{intercept-only}.
341  That is, the regression coefficients are
342  set to zero for all covariates except for the intercept.
343  If \code{zero} is specified then it may be a vector with values
344  from the set \eqn{\{1,2,\ldots,M\}}.
345  The value \code{zero = NULL} means model \emph{all} linear/additive
346  predictors as functions of the explanatory variables.
347  Here, \eqn{M} is the number of linear/additive predictors.
348  Technically, if \code{zero} contains the value \eqn{j} then
349  the \eqn{j}th row of every constraint matrix (except for the
350  intercept) consists of all 0 values.
351
352
353
354  Some \pkg{VGAM} family functions allow the \code{zero} argument to
355  accept negative values; if so then its absolute value is recycled
356  over each (usual) response. For example, \code{zero = -2} for the
357  two-parameter negative binomial distribution would mean,
358  for each response, the second linear/additive predictor is modelled
359  as intercepts-only. That is, for all the \eqn{k} parameters in
360  \code{\link{negbinomial}} (this \pkg{VGAM} family function can handle
361  a matrix of responses).
362
363
364
365  Suppose \code{zero = zerovec} where \code{zerovec} is a vector
366  of negative values. If \eqn{G} is the usual \eqn{M} value for
367  a univariate response then the actual values for argument \code{zero}
368  are all values in
369  \code{c(abs(zerovec), G + abs(zerovec), 2*G + abs(zerovec), ... )}
370  lying in the integer range \eqn{1} to \eqn{M}.
371  For example, setting \code{zero = -c(2, 3)} for a matrix response
372  of 4 columns with \code{\link{zinegbinomial}} (which
373  usually has \eqn{G = M = 3} for a univariate response)
374  would be equivalent to \code{zero = c(2, 3, 5, 6, 8, 9, 11, 12)}.
375  This example has \eqn{M = 12}.
376  Note that if \code{zerovec} contains negative values then their
377  absolute values should be elements from the set \code{1:G}.
378
379
380
381  Note: \code{zero} may have positive and negative values,
382  for example, setting \code{zero = c(-2, 3)} in the above example
383  would be equivalent to \code{zero = c(2, 3, 5, 8, 11)}.
384
385
386
387  The argument \code{zero} also
388  accepts a character vector (for \pkg{VGAM} 1.0-1 onwards).
389  Each value is fed into \code{\link[base]{grep}} with
390  \code{fixed = TRUE}, meaning that wildcards \code{"*"} are not useful.
391  See the example below---all the variants work;
392  those with \code{LOCAT} issue a warning that that value is unmatched.
393Importantly, the parameter names
394are \code{c("location1", "scale1", "location2", "scale2")}
395because there are 2 responses.
396Yee (2015) described \code{zero} for only numerical input.
397Allowing character input is particularly important when the
398number of parameters cannot be determined without having the actual
399data first. For example, with time series data,
400an ARMA(\eqn{p},\eqn{q}) process
401might have parameters \eqn{\theta_1,\ldots,\theta_p} which should
402be intercept-only by default. Then specifying a numerical default
403value for \code{zero} would be too difficult (there are the drift
404and scale parameters too).
405However, it is possible with the character representation:
406\code{zero = "theta"} would achieve this.
407In the future, most \pkg{VGAM} family functions might be converted
408  to the character representation---the advantage being that it
409  is more readable.
410  When programming a \pkg{VGAM} family function that allows character
411  input, the variable \code{predictors.names}
412  must be assigned correctly.
413
414
415
416%Note that \code{zero} accepts wildcards (cf. the Linux operating system):
417%\code{"location*"} means that \emph{all} location parameters
418%are intercept-only.
419% When programming a \pkg{VGAM} family function that allows character
420% input, the variables \code{parameters.names}
421% and \code{Q1}
422
423
424
425  }
426  \item{ishrinkage}{
427  Shrinkage factor \eqn{s} used for obtaining initial values.
428  Numeric, between 0 and 1.
429  In general, the formula used is something like
430  \eqn{s \mu + (1-s) y}{s*mu + (1-s)*y}
431  where \eqn{\mu}{mu} is a measure of central tendency such as a weighted
432  mean or median, and \eqn{y} is the response vector.
433  For example, the initial values are slight perturbations of
434  the mean towards the actual data.
435  For many types of models this method seems to work well and is often
436  reasonably robust to outliers in the response.
437  Often this argument is only used if
438  the argument \code{imethod} is assigned a certain value.
439
440
441
442  }
443  \item{nointercept}{
444  An integer-valued vector specifying which
445  linear/additive predictors have no intercepts.
446  Any values must be from the set \{1,2,\ldots,\eqn{M}\}.
447  A value of \code{NULL} means no such constraints.
448
449
450
451  }
452
453  \item{multiple.responses}{
454  Logical.
455  Some \pkg{VGAM} family functions allow a multivariate or
456  vector response.
457  If so, then usually the response is a matrix with columns
458  corresponding to the individual response variables.
459  They are all fitted simultaneously.
460  Arguments such as \code{parallel} may then be useful to allow
461  for relationships between the regressions of each response variable.
462  If \code{multiple.responses = TRUE} then sometimes the response
463  is interpreted
464  differently, e.g., \code{\link{posbinomial}} chooses the first
465  column of a matrix response as success and combines the other
466  columns as failure, but when \code{multiple.responses = TRUE}
467  then each column
468  of the response matrix is the number of successes and the
469  \code{weights} argument is of the same dimension as the
470  response and contains the number of trials.
471
472
473
474  }
475  \item{earg.link}{
476  This argument should be generally ignored.
477
478
479% Sometimes the link argument can receive \code{earg}-type input,
480% such as \code{\link{quasibinomial}} calling \code{\link{binomial}}.
481
482
483
484  }
485  \item{byrow.arg}{
486  Logical.
487  Some \pkg{VGAM} family functions that handle multiple responses
488  have arguments that allow input to be fed in which affect
489  all the responses,
490  e.g., \code{imu} for initalizing a \code{mu} parameter.
491  In such cases it is sometime more convenient
492  to input one value per response by
493  setting \code{byrow.arg = TRUE}; then values are recycled
494  in order to form a matrix of the appropriate dimension.
495  This argument matches \code{byrow} in \code{\link[base]{matrix}};
496  in fact it is fed into such using \code{matrix(..., byrow = byrow.arg)}.
497  This argument has no effect when there is one response.
498
499
500  }
501  \item{bred}{
502  Logical.
503  Some \pkg{VGAM} family functions will allow bias-reduction based
504  on the work by Kosmidis and Firth.
505  Sometimes half-stepping is a good idea; set \code{stepsize = 0.5}
506  and monitor convergence by setting \code{trace = TRUE}.
507
508
509
510  }
511
512}
513\value{
514  An object of class \code{"vglmff"} (see \code{\link{vglmff-class}}).
515  The object is used by modelling functions such as \code{\link{vglm}}
516  and \code{\link{vgam}}.
517
518
519
520}
521\section{Warning }{
522  The \code{zero} argument is supplied for convenience but conflicts
523  can arise with other arguments, e.g., the \code{constraints}
524  argument of \code{\link{vglm}} and \code{\link{vgam}}.
525  See Example 5 below for an example.
526  If not sure, use, e.g., \code{constraints(fit)} and
527  \code{coef(fit, matrix = TRUE)} to check the result of a fit \code{fit}.
528
529
530  The arguments \code{zero} and \code{nointercept} can be inputted
531  with values that fail. For example,
532  \code{multinomial(zero = 2, nointercept = 1:3)} means the
533  second linear/additive predictor is identically zero,
534  which will cause a failure.
535
536
537  Be careful about the use of other potentially contradictory constraints,
538  e.g., \code{multinomial(zero = 2, parallel = TRUE ~ x3)}. If in doubt,
539  apply \code{constraints()} to the fitted object to check.
540
541
542
543  \pkg{VGAM} family functions with the \code{nsimEIM} may have inaccurate
544  working weight matrices. If so, then the standard errors of the
545  regression coefficients may be inaccurate. Thus output from
546  \code{summary(fit)},
547  \code{vcov(fit)},
548  etc. may be misleading.
549
550
551  Changes relating to the code{lss} argument have very important
552  consequences and users must beware.
553  Good programming style is to rely on the argument names and not
554  on the order.
555
556
557
558}
559
560\details{
561  Full details will be given in documentation yet to be written,
562  at a later date!
563
564
565}
566
567\references{
568
569
570
571Yee, T. W. (2015).
572Vector Generalized Linear and Additive Models:
573With an Implementation in R.
574New York, USA: \emph{Springer}.
575
576
577
578
579Kosmidis, I. and Firth, D. (2009).
580Bias reduction in exponential family nonlinear models.
581\emph{Biometrika},
582\bold{96}(4), 793--804.
583
584
585%Kosmidis, I. and Firth, D. (2010).
586%A generic algorithm for reducing bias in parametric estimation.
587%\emph{Electronic Journal of Statistics},
588%\bold{4}, 1097--1112.
589
590
591
592Miranda-Soberanis, V. F. and Yee, T. W. (2018).
593New link functions for distribution--specific
594quantile regression based on vector generalized linear and
595additive models.
596Manuscript in preparation.
597
598
599
600
601}
602
603\seealso{
604  \code{\link{Links}},
605  \code{\link{vglmff-class}},
606  \code{\link{UtilitiesVGAM}}, \code{\link{normal.vcm}},
607  \code{\link{multilogitlink}},
608  \pkg{VGAMextra}.
609
610
611}
612\author{T. W. Yee}
613
614\note{
615  See \code{\link{Links}} regarding a major change in
616  link functions, for version 0.9-0 and higher
617  (released during the 2nd half of 2012).
618
619
620
621}
622
623\examples{
624# Example 1
625cumulative()
626cumulative(link = "probitlink", reverse = TRUE, parallel = TRUE)
627
628# Example 2
629wdata <- data.frame(x2 = runif(nn <- 1000))
630wdata <- transform(wdata,
631         y = rweibull(nn, shape = 2 + exp(1 + x2), scale = exp(-0.5)))
632fit <- vglm(y ~ x2, weibullR(lshape = logofflink(offset = -2), zero = 2),
633            data = wdata)
634coef(fit, mat = TRUE)
635
636# Example 3; multivariate (multiple) response
637\dontrun{
638ndata <- data.frame(x = runif(nn <- 500))
639ndata <- transform(ndata,
640           y1 = rnbinom(nn, mu = exp(3+x), size = exp(1)),  # k is size
641           y2 = rnbinom(nn, mu = exp(2-x), size = exp(0)))
642fit <- vglm(cbind(y1, y2) ~ x, negbinomial(zero = -2), data = ndata)
643coef(fit, matrix = TRUE)
644}
645# Example 4
646\dontrun{
647# fit1 and fit2 are equivalent
648fit1 <- vglm(ymatrix ~ x2 + x3 + x4 + x5,
649             cumulative(parallel = FALSE ~ 1 + x3 + x5), data = cdata)
650fit2 <- vglm(ymatrix ~ x2 + x3 + x4 + x5,
651             cumulative(parallel = TRUE ~ x2 + x4), data = cdata)
652}
653
654# Example 5
655udata <- data.frame(x2 = rnorm(nn <- 200))
656udata <- transform(udata,
657           y1 = rnorm(nn, mean = 1 - 3*x2, sd = exp(1 + 0.2*x2)),
658           y2 = rnorm(nn, mean = 1 - 3*x2, sd = exp(1)))
659args(uninormal)
660fit1 <- vglm(y1 ~ x2, uninormal, data = udata)            # This is okay
661fit2 <- vglm(y2 ~ x2, uninormal(zero = 2), data = udata)  # This is okay
662
663# This creates potential conflict
664clist <- list("(Intercept)" = diag(2), "x2" = diag(2))
665fit3 <- vglm(y2 ~ x2, uninormal(zero = 2), data = udata,
666             constraints = clist)  # Conflict!
667coef(fit3, matrix = TRUE)  # Shows that clist[["x2"]] was overwritten,
668constraints(fit3)  # i.e., 'zero' seems to override the 'constraints' arg
669
670# Example 6 ('whitespace' argument)
671pneumo <- transform(pneumo, let = log(exposure.time))
672fit1 <- vglm(cbind(normal, mild, severe) ~ let,
673             sratio(whitespace = FALSE, parallel = TRUE), data = pneumo)
674fit2 <- vglm(cbind(normal, mild, severe) ~ let,
675             sratio(whitespace = TRUE,  parallel = TRUE), data = pneumo)
676head(predict(fit1), 2)  # No white spaces
677head(predict(fit2), 2)  # Uses white spaces
678
679# Example 7 ('zero' argument with character input)
680set.seed(123); n <- 1000
681ldata <- data.frame(x2 = runif(n))
682ldata <- transform(ldata, y1 = rlogis(n, loc = 5*x2, scale = exp(2)))
683ldata <- transform(ldata, y2 = rlogis(n, loc = 5*x2, scale = exp(1*x2)))
684ldata <- transform(ldata, w1 = runif(n))
685ldata <- transform(ldata, w2 = runif(n))
686fit7 <- vglm(cbind(y1, y2) ~ x2,
687#        logistic(zero = "location1"),  # location1 is intercept-only
688#        logistic(zero = "location2"),
689#        logistic(zero = "location*"),  # Not okay... all is unmatched
690#        logistic(zero = "scale1"),
691#        logistic(zero = "scale2"),
692#        logistic(zero = "scale"),  # Both scale parameters are matched
693         logistic(zero = c("location", "scale2")),  # All but scale1
694#        logistic(zero = c("LOCAT", "scale2")),  # Only scale2 is matched
695#        logistic(zero = c("LOCAT")),  # Nothing is matched
696#        trace = TRUE,
697#        weights = cbind(w1, w2),
698         weights = w1,
699         data = ldata)
700coef(fit7, matrix = TRUE)
701}
702
703\keyword{models}
704
705