Commit d8aa89e7 authored by Dirk Eddelbuettel's avatar Dirk Eddelbuettel

Import Upstream version 1.5-3

parent 7aa29a81
Package: mgcv
Version: 1.5-2
Version: 1.5-3
Author: Simon Wood <simon.wood@r-project.org>
Maintainer: Simon Wood <simon.wood@r-project.org>
Title: GAMs with GCV/AIC/REML smoothness estimation and GAMMs by PQL
......@@ -11,7 +11,7 @@ Depends: R (>= 2.3.0)
Imports: graphics, stats, nlme
Suggests: nlme (>= 3.1-64), splines
LazyLoad: yes
License: GPL (>=2)
Packaged: 2009-03-26 13:35:41 UTC; simon
License: GPL (>= 2)
Packaged: 2009-04-21 12:16:41 UTC; simon
Repository: CRAN
Date/Publication: 2009-03-26 18:25:48
Date/Publication: 2009-04-22 16:02:00
......@@ -249,7 +249,7 @@ gam.fit3 <- function (x, y, sp, Eb,UrS=list(),
## need an initial `null deviance' to test for initial divergence...
## null.coef <- qr.coef(qr(x),family$linkfun(mean(y)+0*y))
## null.coef[is.na(null.coef)] <- 0
null.eta <- x%*%null.coef + offset
null.eta <- x%*%null.coef + as.numeric(offset)
old.pdev <- sum(dev.resids(y, linkinv(null.eta), weights)) + t(null.coef)%*%St%*%null.coef
## ... if the deviance exceeds this then there is an immediate problem
......
......@@ -1269,7 +1269,7 @@ variable.summary <- function(pf,dl,n) {
## containing raw input variables to a model (i.e. no functions applied)
## pf is a formula containing for the strictly parametric part of the
## model for the variables in af. A list is returned, with names given by
## the variables. For variables in the prametric part, then the list elements
## the variables. For variables in the parametric part, then the list elements
## may be:
## * a 1 column matrix with elements set to the column medians, if variable
## is a matrix.
......@@ -1282,13 +1282,14 @@ variable.summary <- function(pf,dl,n) {
## medians in the above are always observed values (to deal with variables coerced to
## factors in the model formulae in a nice way).
## variables with less than `n' entries are discarded
for (i in 1:length(dl)) if (length(dl[[i]])<n) dl[[i]] <- NULL
v.n <- length(dl)
if (v.n) for (i in 1:v.n) if (length(dl[[i]])<n) dl[[i]] <- NULL
v.name <- names(dl) ## the variable names
p.name <- all.vars(pf[-2]) ## variables in parametric part (not response)
vs <- list()
for (i in 1:length(v.name)) {
v.n <- length(v.name)
if (v.n>0) for (i in 1:v.n) {
if (v.name[i]%in%p.name) para <- TRUE else para <- FALSE ## is variable in the parametric part?
x <- dl[[v.name[i]]]
if (para&&is.matrix(x)) { ## parametric matrix --- a special case
......@@ -1337,6 +1338,10 @@ gam <- function(formula,family=gaussian(),data=list(),weights=NULL,subset=NULL,n
## note can't use get_all_vars here -- buggy with matrices
vars <- all.vars(gp$fake.formula[-2]) ## drop response here
inp <- parse(text = paste("list(", paste(vars, collapse = ","),")"))
## allow a bit of extra flexibility in what `data' is allowed to be (as model.frame actually does)
if (!is.list(data)&&!is.data.frame(data)) data <- as.data.frame(data)
dl <- eval(inp, data, parent.frame())
names(dl) <- vars ## list of all variables needed
var.summary <- variable.summary(gp$pf,dl,nrow(mf)) ## summarize the input data
......
** denotes quite substantial/important changes
*** denotes really big changes
ISSUES
------
[none known]
1.5-3
* `gam' now attempts to coerce `data' to a data frame, if it is not
already a list or a data frame, provided that it is already an object
that model.frame can deal with. This is to support an undocumented
feature of versions prior to 1.5-2 that `data' could actually be
something other than a list or data frame.
* An offset of type "array" could cause gam.fit3 to fail. fixed.
* `variable.summary' bug fixed, (it caused gam(y~1) to fail).
1.5-2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment