Symm()
now works for > 2 factors, fixes #16.- Character strings passed from C to Fortran now handled correctly, fixes #17.
confint.profile.gnm()
now works for a single parametergnm()
now works wheneliminate
is specified asNULL
- allow
set
argument ofgetContrasts()
to be numeric, as documented - convert old tests to unit tests.
- generalize
Diag
andSymm
to work with factors with levels that are not in alphabetical order. Factor levels are now only sorted byDiag
if the input factors have different sets of levels. - make
se()
generic to allow methods to be added (e.g. as in logmult package).
- C routines now registered to avoid accidental clashes with other packages.
- use of
R_forceSymbols
routine requires R >= 3.0.0.
- use of
- use jss.bst vs chicago.bst in vignette.
- update imports to include recommended packages.
- avoid warnings regarding recycling a length 1 array.
- avoid using
print
orcat
outside print methods, so print output always optional (e.g. by settingverbose
argument or usingsuppressMessages
).
- environment of formula preserved when using
gnm()
witheliminate
argument. - allow factor response in binomial gnms.
- allow matrix response in quasibinomial gnms.
- make
x = FALSE
also work when usinggnm()
witheliminate
argument. - allow response in formula to be specified as an expression (e.g.
D/E
) when formula usesinstances
.
- now use lazy data loading.
- improvements to vignette (with thanks to Michael Friendly).
- copyright notices added to source files to clarify authorship, with appropriate credit given to contributors in Rd and DESCRIPTION files.
- predict.gnm now includes eliminate term in predictions on new data.
expandCategorical
now works when there are no covariates in the data.- better handling of single-column model matrices.
predict.gnm
now works withse.fit = TRUE
for models with eliminated terms; correctly handles new data without all levels of homogeneous factors present, and respects contrasts settings.- environment of formula preserved when using instances.
- corrected use of
anova.glmlist
inanova.gnm
.
- added catch for when deviance becomes
NaN
.
- eliminated coefficients now returned as named vector.
- step-quartering introduced to start-up iterations to avoid increasing deviance.
gnm
no longer restarts if algorithm fails - better to provide improved starting values in this case.
- fixed bug in the way
etastart
is used to initialise the linear parameters wheneliminate
is used as well.
- restarting mechanism now reinitialises correctly.
- removed call to external C function that is no longer available.
gnm
now works witheliminate
argument when remaining linear part of predictor only involves one parameter.
pickCoef
extended to allow fixed pattern matching and to optionally return actual coefficients rather than their indices.gnm
now looks for exact match in coefficient names when a single character string is passed to theconstrain
argument before treating as regular expression.hatvalues.gnm
has been reimplemented to work more efficiently for large model matrices."nonlin"
terms defined for homogeneous factors will now accept factors specified as an interaction (using:
).
- results now returned in original order for models fitted with
eliminate
argument. - bug introduced into
residSVD
reverted so that now correctly aggregates working residuals. anova.gnm
now works when model is a single"nonlin"
term.
- factors specified as homogenous in nonlin functions can now be specified as interactions of factors.
- fixed bug so that variables handled correctly in nonlinTerms.
- corrected rank calculation for constrained models.
- removed calls to Internal
- added
meanResiduals
function check
argument added to getContrasts.
- added example SVD calculation to
?wheat
; also in vignette.
- added
update.gnm
so that nonlinear terms were no ordered as linear, first order terms.
-
eliminated coefficients now treated entirely separately, in particular the design matrix no longer has columns for these coefficients, making the algorithm far more efficient for models with many eliminated coefficients.
-
more reliable calculation of rank
-
ofInterest
andconstrain
now index non-eliminated coefficients only. -
eliminated coefficients now returned as attribute of returned coefficient vector.
-
"lsMethod"
argument tognm
removed as now the LAPACK routines are
always used to determine the least squares solution at the heart of the fitting algorithm. HenceqrSolve
andcholInv
deprecated. -
the
"eliminate"
,"onlyFirstCol"
and"onlyNonElim"
arguments toMPinv
have been removed as no longer used.
-
etastart
now works for models with no linear parameters. -
anova
now ignores terms that are completely constrained.
mustart
/etastart
now used to obtain starting values for linear and nonlinear parameters separately, improving performance.
expandCategorical
now groups together individuals with common covariate values, by default. Newgroup
argument added to switch this behaviour.
-
print.profile.gnm
now prints full result. -
data now read in correctly for Lee-Carter example in vignette.
etastart
andmustart
arguments added tognm
.
gnm
now returnsdata
argument asglm
does.
- more minor corrections in documentation.
- minor corrections in documentation.
getContrasts
can now estimate scaled contrasts with more flexibility in how the reference level is defined.- changed tolerance level in checkEstimable to
1e6 * .Machine$double.eps
as previous tolerance too strict for some examples.
getContrasts
now only handles one set of parameters at a time.- use of
Const
is now restricted to the symbolic predictors of"nonlin"
functions. Nonlin
- the wrapper function for plug-in functions - is now defunct. Use"nonlin"
functions to specify custom nonlinear terms.
plot.gnm
now uses standardised Pearson residuals for plotwhich = 5
so that the Cook's distance contours are correct
predict
now implemented for"gnm"
objects
- results formatted as contingency tables where appropriate by extractor
functions (
fitted
, etc), rather thangnm
- default for
match
argument ofnonlinTerms
now zero vector (i.e. no matching to arguments ofcall
by default)
termPredictors
now works on"gnm"
objects fitted withglm.fit
- intercept removed when
eliminate
argument ofgnm
is non-NULL
- models with all parameters eliminated now summarised sensibly
Diag
andSymm
now work for factors of length 1- as
gnm
now returns object with"gnm"
-type terms component - print method for
"profile.gnm"
objects now exported
- added
DrefWeights
for computing the weights in a diagonal reference term and the corresponding standard errors.
"assign"
attribute now attached to the parameter vector when passed to start functions defined by"nonlin"
functions, specifying the correspondence between parameters and predictors in the nonlinear term.
-
start function in
Dref
now identifies weight parameters correctly. -
can now evaluate term predictors for
"nonlin"
terms that depend on covariates.
- Calls to
"nonlin"
functions now evaluated in the same environment and enclosure as call to create model frame, so"nonlin"
functions should be able to find variables in gnm calls - potentially useful for setting starting values.
-
gnm
algorithm now reinitiates correctly when restarting after non-convergence. -
gnm
now works correctly when a model is specified with nonlinear terms in between linear terms.
-
introduction of functions of class
"nonlin"
for the unified specification of nonlinear terms.Mult
,Exp
,Dref
andMultHomog
have all been converted to functions of this class. -
added
Inv
to specify the reciprocal of a predictor. -
added
Const
to specify a constant in a predictor. -
added
instances
to specify multiple instances of a nonlinear term.
-
nonlinear terms can now be nested.
-
Exp
can now be used outside ofMult
or to exponentiate part of a constituent multiplier.
-
to accommodate the increased functionality introduced by
"nonlin"
functions, new labelling conventions have been introduced. In particular, most"nonlin"
functions use argument-matched parameter labels. -
in the new implementation of
Dref
theformula
argument has been re-nameddelta
to provide more informative parameter labels under the new conventions.
- specifying
ofInterest = "[?]"
ingnm
now works as documented.
none in this release
-
added a new
ridge
argument to gnm, to allow some control over the Levenberg-Marquardt regularization of the internal least squares calculation -
changed the default ridge constant to 1e-8 (from 1e-5), to increase speed of convergence (especially in cases where there are infinite parameter estimates)
-
modified the
"qr"
method so that it no longer checks for rank deficiency (it was both unreliable, and not necessary since the matrix is regularized prior to solving) -
substantial speed improvements in model fitting when there are large numbers of eliminated parameters, achieved mainly via a new internal function
cholInv1
. Corresponding example timings changed in the Overview document (vignette). -
speed improvements in
vcov.gnm
when there are eliminated parameters; new logical argumentuse.eliminate
gives control over this -
in
getContrasts
, added new argumentsdispersion
anduse.eliminate
, both of which are passed on tovcov
-
implemented faster alternatives to
ifelse
ingnmFit
-
speed gains from use of
tcrossprod
. Because of this the gnm package now requires R 2.3.0 or later.
-
in
gnm
, changed the default value of argument x toTRUE
(it was previouslyFALSE
) -
in
checkEstimable
, changed the name of the first argument fromcoefMatrix
tocombMatrix
(to reflect better that it is a matrix of coefficient combinations); and changed the default tolerance value to one which should give more reliable results. Also, more fundamentally, changed the check to be whether combinations are in the column span ofcrossprod(X)
instead of the row span ofX
; the results should be the same, but the new version is much faster for large n. -
model.matrix.gnm
no longer passes extra arguments to gnm as it's unlikely to be useful/sensible. For the same reasons it will not pass extra arguments tomodel.frame
, unlikemodel.matrix.lm
-
getContrasts
now results in a list only when thesets
argument itself is a list; otherwise (i.e., normally) the result is a single object (rather than a list of objects) of classqv
-
fixed a bug in internal function
quick.glm.fit
, which greatly improves its performance. Also changed the default value of thenIter
argument from 3 to 2. -
fixed a small bug in
demo(gnm)
-
fixed a bug in
vcov.gnm
, which previously gave an error when data were of class"table"
) -
fixed
summary.gnm
so that it now takes proper account of the dispersion argument -
in
se
, added new argumentsVcov
anddispersion
; the latter fixes a bug, while the former minimizes wasted computation insummary.gnm
-
fixed bug in
model.matrix.gnm
so that it can compute the model matrix even when original data is not available - unless model frame has not been saved. Original data still needed to update model frame - this is the same as for glms, etc. -
fixed bug in
gnm
so that reconstructing"table"
-class data works for models with weights/offsets
-
added
"gnm"
methods forprofile
andconfint
. Use ofalpha
argument differs slightly from"glm"
methods: see help files. -
constrain
argument tognm
now supplemented byconstrainTo
argument, allowing specification of values to which parameters should be constrained. -
gnm
now hasofInterest
argument to specify a subset of coefficients which are of interest - returned inofInterest
component of"gnm"
object as named numeric vector.print
summaries of model object/its components extracted by accessor functions only print coefficients of interest and (where appropriate) methods for"gnm"
objects select coefficients of interest by default. -
added
ofInterest
andofInterest<-
to extract/replaceofInterest
component of"gnm"
object. -
added
parameters
which returns coefficient vector with constrained parameters replaced by their constrained value. -
added
pickCoef
function to aid selection of coefficients - returns numeric indices of coefficients selected by Tk dialog or regular expression matching.
constrain
argument tognm
now accepts a regular expression to match against coefficient names.
-
constrain
component of"gnm"
objects is now a numeric, rather than logical, vector of indices. -
all
"gnm"
methods for which a subset of the coefficients may be specified by numeric indices now interpret those indices as referencing the full coefficient vector (not just non-eliminated parameters). -
gnm
now preserves order of terms rather than moving all linear terms to the start (this fixes bug inanova.gnm
). -
the
"pick"
option for theconstrain
argument tognm
and theestimate
argument tose
has been replaced by"[?]"
to avoid possible conflict with coefficient names/regular expressions.
-
fixed bug in
se
so will now work for single parameter. -
fixed bug in
summary.gnm
so will now work for models with one parameter. -
fixed bug in
anova
so that rows of returned table are correct for models with eliminated terms. -
fixed bug in
eliminate
so that it now accepts interactions. -
fixed bug in
MPinv
so that it works for models in which all parameters are eliminated.
- improved use of functions from other packages
-
fixed bug in
asGnm.lm
where object not fully identified -
corrected maintainer address in DESCRIPTION!
-
added demonstration script to run using
demo
-
added package help file, opened by package?gnm
- improved existing documentation
-
added the
method
argument toMPinv
, to allow the method of calculation to be specified. Permitted values are"svd"
to compute the pseudo-inverse by singular value decomposition, and"chol"
to use the Cholesky decomposition instead. The latter is valid only for symmetric matrices, but is usually faster and more accurate. -
added the
lsMethod
argument tognm
, to allow specification of the numerical method used for least-squares calculations in the core of the iterative algorithm. Permitted options are"chol"
and"qr"
. -
added new function
qrSolve
, which behaves likebase::qr.coef
but in the non-full-rank case gives the minimum-length solution rather than an arbitrary solution determined by pivoting. -
added
.onUnload
so that compiled code is unloaded when namespace of package is unloaded usingunloadNamespace
. -
added
coef
argument tomodel.matrix.gnm
so that the model matrix can be evaluated at any specified value of the parameter vector. -
added as
gnm
generic to coerce linear model objects to gnm objects. -
added
exitInfo
for printing numerical details of last iteration on non-convergence ofgnm
. -
added new dataset, friend, to illustrate a workaround to fit a homogeneous RC(2) using
gnm
- documented in help file forMultHomog
.
-
gnm
now takes less time per (main) iteration, due to improvements made internally in the iterative algorithm. These include pre-scaling of the local design matrix, and Levenberg-Marquardt adjustment of the least-squares solvers so that rank determination is no longer necessary. -
the default convergence tolerance has been tightened (from 1e-4 to 1e-6)
-
modified
model.matrix.gnm
so it can be used when only the namespace of gnm is loaded.
-
fixed bug in
gnm
so thatsubset
now works with table data. -
fixed bug in
model.matrix.gnm
so can construct model matrix from"gnm"
object even when original call not made in.GlobalEnv
. -
fixed bug in the examples on help page for
House2001
data. -
fixed bug so that
formula
ingnm
now accepts.
in formulae even wheneliminate = NULL
. -
fixed bug in
getContrasts
, so that the first two columns of the qvframe component of each element of the result list are correctly named as "estimate" and "SE", as required for objects of class "qv".
-
added
"model.matrix"
option formethod
argument ofgnm
so that model matrix can be obtained much faster. The new method is used inmodel.matrix.gnm
andvcov.gnm
. -
added new utility function
residSVD
, to facilitate the calculation of good starting values for parameters in certainMult
terms. -
added new dataset
House2001
, to illustrate the use ofgnm
in Rasch-type scaling of legislator votes. -
added new utility function
expandCategorical
for expanding data frame on the basis of a categorical variable. -
added
formula.gnm
method - returns formula from"gnm"
object excluding theeliminate
d factor where necessary.
-
gnm
now takes less time to run due to improvements made in internal functions. -
the fitting algorithm used by
gnm
now copes better with zero-valued residuals. -
output given by
gnm
whentrace = TRUE
orverbose = TRUE
is now displayed as it is generated on console-based versions of R. -
plot.gnm
now includes optionwhich = 5
as inplot.lm
in R >= 2.2.0. Now has separate help page. -
the
constrain
argument tognm
now accepts the names of parameters. -
the
formula
argument tognm
now accepts.
as described in?terms.formula
, ignoring eliminated factor if indata
. -
interface for
se
extended - can now use to find standard errors for all parameters or (a selection of) individual parameters in a gnm model. -
made it possible to use
gnm
with alternative fitting function. -
".Environment"
attribute now attached to"gnm"
objects so that gnm package loaded when workspace containing"gnm"
objects is loaded.
-
start-up iterations now only update column of design matrix required in next iteration. Therefore plug-in functions using the default start-up procedure for nonlinear parameters need a
localDesignFunction
with the argumentind
specifying the column that should be returned. -
modified output given by
gnm
whentrace = TRUE
: now prints initial deviance and the deviance at the end of each iteration. -
modified updates of linear parameters in starting procedure: now offset contribution of fully specified terms only.
-
results of
summary.gnm
,vcov.gnm
andcoef.gnm
now include any eliminated parameters. Print methods have been added for"vcov.gnm"
and"coef.gnm"
objects so that any eliminated parameters are not shown. -
Mult
terms are no longer split into components byanova.gnm
,termPredictors.gnm
,labels.gnm
or the"assign"
attribute of the model matrix - consistent withterms
output. -
the
eliminate
argument tognm
must now be an expression that evaluates to a factor - this reverts the extension of 0.7-2. -
when using
gnm
withconstrain = "pick"
, the name(s) of the chosen parameter(s) will replace"pick"
in the returned model call. -
getContrasts
now uses first level of a factor as the reference level (by default). -
gnmControl
replaced by arguments tognm
. -
gnm
now usesglm.fit
for linear models (with control parameters at thegnm
defaults) unlesseliminate
is non-NULL
. -
vcov.gnm
andsummary.gnm
now return variance-covariance matrices including any aliased parameters. -
summary.gnm
now returns standard errors with test statistics etc, where estimated parameters are identified.
-
fixed bug in
summary.gnm
,anova.gnm
,termPredictors.gnm
andmodel.matrix.gnm
where search for model variables was incorrect. -
fixed bug preventing estimation of weight parameters in
Dref
terms and changed default starting values so that these parameters no longer sum to one or appear to be estimable. -
corrected options for
method
argument ingnm
help file: replacedmethod = "coef"
withmethod = "coefNames"
. -
fixed bug in
gnm
so that it can handle tables with missing values when formatting components of fit. -
hatvalues.gnm
now works for objects produced from table data. -
residuals.gnm
now returns table not matrix whentype = "deviance"
for"gnm"
objects produced from table data. -
hatvalues.gnm
,cooks.distance.gnm
andplot.gnm
now handle cases which are fitted exactly (giving a hat value of 1). -
example fitting proportional odds model in
backPain
help file now works. -
fixed bug in
Mult
terms so that an offset can be added to a constituent multiplier without an unspecified intercept being added also. -
gnm
argumentconstrain = "pick"
now allows selection of more than one constraint and is compatible with use ofeliminate
. -
gnm
can now fit models which only have the term specified byeliminate
.
- Extended use of the
eliminate
argument ofgnm
to allow crossed factors - this also fixes bug which occurred when interactions were eliminated in the presence of lower order terms involving other factors
vcov
returned bygnm
now has no rank attribute (as before, the rank is returned as the separate componentrank
).
-
Changed the calculation of
df.residual
returned bygnm
to correctly take account of zero-weighted observations (as inglm
). -
When
gnm
is called with argumentsx = TRUE
orVCOV = TRUE
, the returned matrices now include columns of zeros for constrained parameters. -
Corrected evaluation of model frame in
gnm
so that if data is missing, variables are taken fromenvironment(formula)
, as documented. Modified evaluation of plug-in functions to be consistent with this, i.e. objects are taken fromenvironment(formula)
if not in model frame. -
MPinv
now checks that the diagonal elements of aneliminate
d submatrix are all non-zero and reports an error otherwise.
-
Topo
introduced for creating topological interaction factors. -
anova
implemented for objects of classc("gnm", "glm")
.
-
Diagnostic messages given by
gnm
have been improved. -
Step-halving introduced in main iterations of
gnm
to ensure deviance is reduced at every iteration. -
getContrasts
now (additionally) reports quasi standard errors, when available. -
Calls to
gnm
plug-in functions are now evaluated in the environment of the model frame and the enclosing environment of the parent frame of the call tognm
. This means that variables can be found in a more standard fashion.
-
The
data
argument ofNonlin
is defunct:Nonlin
now identifies variables to be added to the model frame as those passed to unspecified arguments of the plug-in function or those identified by a companion function to the plug-in, which is of a specified format. -
The (optional)
start
object returned by a plug-in function can no longer be a function, only a vector. However it may now includeNA
values, to indicate parameters which may be treated as linear for the purpose of finding starting values, given the non-NA
values.
-
The
eliminate
argument ofgnm
now handles functions of variables in the given formula e.g.~ strata(A, B), ~ as.factor(A):as.factor(B)
, etc. -
gnm
was giving an error for models with either no linear parameters, or none specified by thestart
argument, this is now fixed. -
Long calls to plug-in functions caused problems in parsing the model formula: now fixed.
-
gnm
now only restarts after failing if there are unspecified nonlinear parameters. -
gnm
now returnsNULL
if model fails. -
Bug fixed in calculation of starting values for
gnm
that occurred when some parameters were constrained.