diff -Nru mgcv-1.8-23/ChangeLog mgcv-1.8-24/ChangeLog --- mgcv-1.8-23/ChangeLog 2018-01-08 15:15:29.000000000 +0000 +++ mgcv-1.8-24/ChangeLog 2018-06-18 13:01:38.000000000 +0000 @@ -1,9 +1,62 @@ ** denotes quite substantial/important changes *** denotes really big changes +Liable to change in future release: +- method="GCV.Cp" as default in gam. Default will + change to "REML". (1.8-24, June 2018) + Currently deprecated and liable to be removed: - gam performance iteration (1.8-19, Sept 2017) -- argument 'pers' in plot.gam (1.8-23, Nov 2018) +- argument 'pers' in plot.gam (1.8-23, Nov 2017) + +Issues: + +* t2 in bam(...,discrete=TRUE) - not treated as tensor products at +present, and reparameterization needs checking (also for bam). + +1.8-24 + +* Extended Fellner Schall optimizer now avaialable for all families with 'gam' + using gam(...,optimizer="efs"). + +* Change to default behaviour of plot.gam when 'seWithMean=TRUE', and of + predict.gam when 'type="iterms"'. The extra uncertainty added to CIs or + standard errors now reflects the uncertainty in the mean in all other model + terms, not just the uncertanity in the mean of the fixed effects as before. + See ?plot.gam and ?predict.gam (including for how to get the old behaviour). + +* 're' smooths can now accept matrix arguments: see ?linear.functional.terms. + +* cox.ph now allows an offset to be provided. + +* Fix in smoothCon for bug in case in which only a single coefficient is + involved in a sum-to-zero constraint. Could cause failure in e.g. t2 with + cc marginal. + +* Model terms s, te etc are now always evaluated in mgcv workspace explicitly + to avoid masking problems in obscure circumstances. + +* 'mrf' smooth documentation modified to make it clearer how to specify 'nb', + and code modified so that it is now possible to speficy the neighbour + structure using names rather than indices. + +* 'bfgs' fix to handle extended families. + +* plot.gam modified to only prompt (via devAskNewPage) for a new page after + the first page is used up. + +* export 'k.check'. + +* Fix to 'Rrank'. Previously a matrix R with more columns than rows could + cause a segfault. + +* Fix to non-finite likelihood handling in gam.fit5. + +* Fix in bgam.fitd to step reduce under indefinite deviance and to ensure + penalty evaluation is round off negative proof. + +* newton slighty modified to avoid (small) chance of all sp's being dropped + for indef likelihood. 1.8-23 diff -Nru mgcv-1.8-23/debian/changelog mgcv-1.8-24/debian/changelog --- mgcv-1.8-23/debian/changelog 2018-06-19 15:06:15.000000000 +0000 +++ mgcv-1.8-24/debian/changelog 2018-06-19 15:04:10.000000000 +0000 @@ -1,8 +1,30 @@ -mgcv (1.8-23-1artful0) artful; urgency=medium +mgcv (1.8-24-1cran1cranArtful0) artful; urgency=medium + * Changed build dependency to any release of R * Compilation for Ubuntu 17.10 - -- Michael Rutter Sun, 21 Jan 2018 15:27:01 +0000 + -- Michael Rutter Tue, 19 Jun 2018 15:04:10 +0000 + +mgcv (1.8-24-1) unstable; urgency=medium + + * New upstream release + + -- Dirk Eddelbuettel Mon, 18 Jun 2018 16:17:43 -0500 + +mgcv (1.8-23-1.1) unstable; urgency=medium + + * (Inofficial) Rebuild for R 3.5.0 + + * Manual override for ${R:Depends} while dh-r is looked at + + * debian/control: Set Build-Depends: to current R version + * debian/control: Set Standards-Version: to current version + * debian/control: Add Vcs-Browser: and Vcs-Git: + * debian/compat: Increase level to 9 + * debian/control: Switch from cdbs to dh-r + * debian/rules: Idem + + -- Dirk Eddelbuettel Sat, 28 Apr 2018 15:08:02 -0500 mgcv (1.8-23-1) unstable; urgency=medium diff -Nru mgcv-1.8-23/debian/control mgcv-1.8-24/debian/control --- mgcv-1.8-23/debian/control 2018-06-19 15:06:15.000000000 +0000 +++ mgcv-1.8-24/debian/control 2018-06-19 14:40:24.000000000 +0000 @@ -2,12 +2,15 @@ Section: gnu-r Priority: optional Maintainer: Dirk Eddelbuettel -Build-Depends: debhelper (>= 7.0.0), r-base-dev (>= 3.4.3), r-cran-nlme, r-cran-matrix, cdbs -Standards-Version: 4.1.3 +Build-Depends: debhelper (>= 7.0.0), r-base-dev, r-cran-nlme, r-cran-matrix, dh-r +Standards-Version: 4.1.4 +Vcs-Browser: https://salsa.debian.org/edd/r-cran-mgcv +Vcs-Git: https://salsa.debian.org/edd/r-cran-mgcv.git +Homepage: https://cran.r-project.org/package=mgcv Package: r-cran-mgcv Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, ${R:Depends}, r-cran-nlme, r-cran-matrix +Depends: ${R:Depends}, ${shlibs:Depends}, ${misc:Depends}, r-cran-nlme, r-cran-matrix Replaces: r-recommended (<< 1.9.0) Description: GNU R package for multiple parameter smoothing estimation This package provides functions for generalised additive models (GAMs) diff -Nru mgcv-1.8-23/debian/rules mgcv-1.8-24/debian/rules --- mgcv-1.8-23/debian/rules 2018-06-19 15:06:15.000000000 +0000 +++ mgcv-1.8-24/debian/rules 2018-04-28 20:06:40.000000000 +0000 @@ -1,14 +1,7 @@ #!/usr/bin/make -f # -*- makefile -*- # debian/rules file for the Debian/GNU Linux r-cran-mgcv package -# Copyright 2004-2006 by Dirk Eddelbuettel - -include /usr/share/R/debian/r-cran.mk - -## override the default as this is an r-recommended package -debRlib := $(CURDIR)/debian/$(package)/usr/lib/R/library - -## additional chmod to silence lintian (NB -arch or -indep needed!!) -common-binary-post-install-arch:: - chmod -v 0644 $(debRlib)/$(cranName)/CITATION +# Copyright 2004 - 2018 by Dirk Eddelbuettel +%: + dh $@ --buildsystem R diff -Nru mgcv-1.8-23/debian/source/format mgcv-1.8-24/debian/source/format --- mgcv-1.8-23/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ mgcv-1.8-24/debian/source/format 2013-09-06 11:05:46.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru mgcv-1.8-23/DESCRIPTION mgcv-1.8-24/DESCRIPTION --- mgcv-1.8-23/DESCRIPTION 2018-01-15 00:23:36.000000000 +0000 +++ mgcv-1.8-24/DESCRIPTION 2018-06-18 19:07:59.000000000 +0000 @@ -1,5 +1,5 @@ Package: mgcv -Version: 1.8-23 +Version: 1.8-24 Author: Simon Wood Maintainer: Simon Wood Title: Mixed GAM Computation Vehicle with Automatic Smoothness @@ -18,6 +18,6 @@ ByteCompile: yes License: GPL (>= 2) NeedsCompilation: yes -Packaged: 2018-01-08 15:15:43 UTC; sw283 +Packaged: 2018-06-18 13:08:20 UTC; sw283 Repository: CRAN -Date/Publication: 2018-01-15 00:23:36 UTC +Date/Publication: 2018-06-18 19:07:59 UTC Binary files /tmp/tmpJT37E1/TEdASq7Ppz/mgcv-1.8-23/inst/po/de/LC_MESSAGES/mgcv.mo and /tmp/tmpJT37E1/WaJACiMdrZ/mgcv-1.8-24/inst/po/de/LC_MESSAGES/mgcv.mo differ Binary files /tmp/tmpJT37E1/TEdASq7Ppz/mgcv-1.8-23/inst/po/de/LC_MESSAGES/R-mgcv.mo and /tmp/tmpJT37E1/WaJACiMdrZ/mgcv-1.8-24/inst/po/de/LC_MESSAGES/R-mgcv.mo differ Binary files /tmp/tmpJT37E1/TEdASq7Ppz/mgcv-1.8-23/inst/po/en@quot/LC_MESSAGES/mgcv.mo and /tmp/tmpJT37E1/WaJACiMdrZ/mgcv-1.8-24/inst/po/en@quot/LC_MESSAGES/mgcv.mo differ Binary files /tmp/tmpJT37E1/TEdASq7Ppz/mgcv-1.8-23/inst/po/en@quot/LC_MESSAGES/R-mgcv.mo and /tmp/tmpJT37E1/WaJACiMdrZ/mgcv-1.8-24/inst/po/en@quot/LC_MESSAGES/R-mgcv.mo differ Binary files /tmp/tmpJT37E1/TEdASq7Ppz/mgcv-1.8-23/inst/po/fr/LC_MESSAGES/mgcv.mo and /tmp/tmpJT37E1/WaJACiMdrZ/mgcv-1.8-24/inst/po/fr/LC_MESSAGES/mgcv.mo differ Binary files /tmp/tmpJT37E1/TEdASq7Ppz/mgcv-1.8-23/inst/po/fr/LC_MESSAGES/R-mgcv.mo and /tmp/tmpJT37E1/WaJACiMdrZ/mgcv-1.8-24/inst/po/fr/LC_MESSAGES/R-mgcv.mo differ Binary files /tmp/tmpJT37E1/TEdASq7Ppz/mgcv-1.8-23/inst/po/ko/LC_MESSAGES/mgcv.mo and /tmp/tmpJT37E1/WaJACiMdrZ/mgcv-1.8-24/inst/po/ko/LC_MESSAGES/mgcv.mo differ Binary files /tmp/tmpJT37E1/TEdASq7Ppz/mgcv-1.8-23/inst/po/ko/LC_MESSAGES/R-mgcv.mo and /tmp/tmpJT37E1/WaJACiMdrZ/mgcv-1.8-24/inst/po/ko/LC_MESSAGES/R-mgcv.mo differ Binary files /tmp/tmpJT37E1/TEdASq7Ppz/mgcv-1.8-23/inst/po/pl/LC_MESSAGES/mgcv.mo and /tmp/tmpJT37E1/WaJACiMdrZ/mgcv-1.8-24/inst/po/pl/LC_MESSAGES/mgcv.mo differ Binary files /tmp/tmpJT37E1/TEdASq7Ppz/mgcv-1.8-23/inst/po/pl/LC_MESSAGES/R-mgcv.mo and /tmp/tmpJT37E1/WaJACiMdrZ/mgcv-1.8-24/inst/po/pl/LC_MESSAGES/R-mgcv.mo differ diff -Nru mgcv-1.8-23/man/bam.Rd mgcv-1.8-24/man/bam.Rd --- mgcv-1.8-23/man/bam.Rd 2017-11-15 08:50:09.000000000 +0000 +++ mgcv-1.8-24/man/bam.Rd 2018-06-06 11:55:38.000000000 +0000 @@ -218,9 +218,9 @@ This routine is less stable than `gam' for the same dataset. -The negbin family is only supported for the *known theta* case. - +With \code{discrete=TRUE}, \code{te} terms are efficiently computed, but \code{t2} are not. +The negbin family is only supported for the *known theta* case. } \seealso{\code{\link{mgcv.parallel}}, @@ -236,9 +236,7 @@ library(mgcv) ## See help("mgcv-parallel") for using bam in parallel -## Some examples are marked 'Not run' purely to keep -## checking load on CRAN down. Sample sizes are small for -## the same reason. +## Sample sizes are small for fast run times. set.seed(3) dat <- gamSim(1,n=25000,dist="normal",scale=20) @@ -263,6 +261,14 @@ data=dat,family=poisson())) b1 +## Similar using faster discrete method... + +\donttest{ +system.time(b2 <- bam(y ~ s(x0,bs=bs,k=k)+s(x1,bs=bs,k=k)+s(x2,bs=bs,k=k)+ + s(x3,bs=bs,k=k),data=dat,family=poisson(),discrete=TRUE)) +b2 +} + } diff -Nru mgcv-1.8-23/man/coxpht.Rd mgcv-1.8-24/man/coxpht.Rd --- mgcv-1.8-23/man/coxpht.Rd 2017-07-26 11:09:13.000000000 +0000 +++ mgcv-1.8-24/man/coxpht.Rd 2018-06-06 11:55:38.000000000 +0000 @@ -60,8 +60,8 @@ dap[1:(start-1),] } ## tdpois -## The following takes too long for CRAN checking -## (but typically takes a minute or less). +## The following typically takes a minute or less... + \donttest{ ## Convert pbcseq to equivalent Poisson form... pbcseq$status1 <- as.numeric(pbcseq$status==2) ## death indicator diff -Nru mgcv-1.8-23/man/gam.control.Rd mgcv-1.8-24/man/gam.control.Rd --- mgcv-1.8-23/man/gam.control.Rd 2016-10-15 07:04:32.000000000 +0000 +++ mgcv-1.8-24/man/gam.control.Rd 2018-05-11 12:09:47.000000000 +0000 @@ -12,10 +12,11 @@ \usage{ gam.control(nthreads=1,irls.reg=0.0,epsilon = 1e-07, maxit = 200, mgcv.tol=1e-7,mgcv.half=15, trace = FALSE, - rank.tol=.Machine$double.eps^0.5, - nlm=list(),optim=list(),newton=list(), - outerPIsteps=0,idLinksBases=TRUE,scalePenalty=TRUE, - keepData=FALSE,scale.est="fletcher",edge.correct=FALSE) + rank.tol=.Machine$double.eps^0.5,nlm=list(), + optim=list(),newton=list(),outerPIsteps=0, + idLinksBases=TRUE,scalePenalty=TRUE,efs.lspmax=15, + efs.tol=.1,keepData=FALSE,scale.est="fletcher", + edge.correct=FALSE) } \arguments{ \item{nthreads}{Some parts of some smoothing parameter selection methods (e.g. REML) can use some @@ -72,6 +73,12 @@ the penalty matrices to accomodate this problem. Probably should be set to \code{FALSE} if you are linking smoothing parameters but have set \code{idLinkBases} to \code{FALSE}.} +\item{efs.lspmax}{maximum log smoothing parameters to allow under extended Fellner Schall +smoothing parameter optimization.} + +\item{efs.tol}{change in REML to count as negligible when testing for EFS convergence. If the +step is small and the last 3 steps led to a REML change smaller than this, then stop.} + \item{keepData}{Should a copy of the original \code{data} argument be kept in the \code{gam} object? Strict compatibility with class \code{glm} would keep it, but it wastes space to do so. } diff -Nru mgcv-1.8-23/man/gam.Rd mgcv-1.8-24/man/gam.Rd --- mgcv-1.8-23/man/gam.Rd 2017-11-03 13:07:20.000000000 +0000 +++ mgcv-1.8-24/man/gam.Rd 2018-05-11 12:09:47.000000000 +0000 @@ -87,7 +87,7 @@ for the more stable direct approach. \code{"outer"} can use several alternative optimizers, specified in the second element of \code{optimizer}: \code{"newton"} (default), \code{"bfgs"}, \code{"optim"}, \code{"nlm"} and \code{"nlm.fd"} (the latter is based entirely on finite differenced derivatives and is very slow). \code{"efs"} -for the extended Fellner Schall method - only currently available for general families.} +for the extended Fellner Schall method of Wood and Fasiolo (2017).} \item{scale}{ If this is positive then it is taken as the known scale parameter. Negative signals that the scale parameter is unknown. 0 signals that the scale parameter is 1 for Poisson and binomial and unknown otherwise. @@ -298,6 +298,10 @@ Wood S.N. (2017) Generalized Additive Models: An Introduction with R (2nd edition). Chapman and Hall/CRC Press. +Wood, S.N. and M. Fasiolo (2017) A generalized Fellner-Schall method for smoothing +parameter optimization with application to Tweedie location, scale and shape models. +Biometrics 73 (4), 1071-1081 + Wood S.N., F. Scheipl and J.J. Faraway (2012) Straightforward intermediate rank tensor product smoothing in mixed models. Statistical Computing. diff -Nru mgcv-1.8-23/man/gevlss.Rd mgcv-1.8-24/man/gevlss.Rd --- mgcv-1.8-23/man/gevlss.Rd 2017-02-24 14:02:46.000000000 +0000 +++ mgcv-1.8-24/man/gevlss.Rd 2018-05-11 12:09:47.000000000 +0000 @@ -24,7 +24,9 @@ This family does not produce a null deviance. Note that the distribution for \eqn{\xi=0}{xi=0} is approximated by setting \eqn{\xi}{xi} to a small number. -The derivative system code for this family is mostly auto-generated, and the family is still somewhat experimental. +The derivative system code for this family is mostly auto-generated, and the family is still somewhat experimental. + +The GEV distribution is rather challenging numerically, and for small datasets or poorly fitting models imporoved numerical robustness may be obtained by using the extended Fellner-Schall method of Wood and Fasiolo (2017) for smoothing parameter estimation. See examples. } \references{ @@ -36,6 +38,8 @@ Journal of the American Statistical Association 111, 1548-1575 \url{http://dx.doi.org/10.1080/01621459.2016.1180986} +Wood, S.N. and M. Fasiolo (2017) A generalized Fellner-Schall method for smoothing parameter optimization with application to Tweedie location, scale and shape models. Biometrics 73(4): 1071-1081. +\url{http://dx.doi.org/10.1111/biom.12666} } @@ -66,6 +70,11 @@ ## fit model.... b <- gam(list(y~s(x2),~s(x0),~s(x1)),family=gevlss,data=dat) +## same fit using the extended Fellner-Schall method which +## can provide improved numerical robustness... +b <- gam(list(y~s(x2),~s(x0),~s(x1)),family=gevlss,data=dat, + optimizer="efs") + ## plot and look at residuals... plot(b,pages=1,scale=0) summary(b) diff -Nru mgcv-1.8-23/man/jagam.Rd mgcv-1.8-24/man/jagam.Rd --- mgcv-1.8-23/man/jagam.Rd 2016-12-02 10:54:55.000000000 +0000 +++ mgcv-1.8-24/man/jagam.Rd 2018-05-15 07:57:44.000000000 +0000 @@ -147,10 +147,21 @@ ## regular gam fit for comparison... b0 <- gam(y~s(x0)+s(x1) + s(x2)+s(x3),data=dat,method="REML") +## Set directory and file name for file containing jags code. +## In real use you would *never* use tempdir() for this. It is +## only done here to keep CRAN happy, and avoid any chance of +## an accidental overwrite. Instead you would use +## setwd() to set an appropriate working directory in which +## to write the file, and just set the file name to what you +## want to call it (e.g. "test.jags" here). + +jags.file <- paste(tempdir(),"/test.jags",sep="") + ## Set up JAGS code and data. In this one might want to diagonalize ## to use conjugate samplers. Usually call 'setwd' first, to set ## directory in which model file ("test.jags") will be written. -jd <- jagam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat,file="test.jags", + +jd <- jagam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat,file=jags.file, sp.prior="gamma",diagonalize=TRUE) ## In normal use the model in "test.jags" would now be edited to add @@ -159,7 +170,7 @@ \dontrun{ require(rjags) load.module("glm") ## improved samplers for GLMs often worth loading -jm <-jags.model("test.jags",data=jd$jags.data,inits=jd$jags.ini,n.chains=1) +jm <-jags.model(jags.file,data=jd$jags.data,inits=jd$jags.ini,n.chains=1) list.samplers(jm) sam <- jags.samples(jm,c("b","rho","scale"),n.iter=10000,thin=10) jam <- sim2jam(sam,jd$pregam) @@ -178,7 +189,7 @@ scale <- .5; Ey <- exp(dat$f/2) dat$y <- rgamma(n,shape=1/scale,scale=Ey*scale) jd <- jagam(y~s(x0)+te(x1,x2)+s(x3),data=dat,family=Gamma(link=log), - file="test.jags",sp.prior="log.uniform") + file=jags.file,sp.prior="log.uniform") ## In normal use the model in "test.jags" would now be edited to add ## the non-standard stochastic elements that require use of JAGS.... @@ -189,7 +200,7 @@ ## models are still not fully repeatable (JAGS 4 should fix this) jd$jags.ini$.RNG.name <- "base::Mersenne-Twister" ## setting RNG jd$jags.ini$.RNG.seed <- 6 ## how to set RNG seed -jm <-jags.model("test.jags",data=jd$jags.data,inits=jd$jags.ini,n.chains=1) +jm <-jags.model(jags.file,data=jd$jags.data,inits=jd$jags.ini,n.chains=1) list.samplers(jm) sam <- jags.samples(jm,c("b","rho","scale","mu"),n.iter=10000,thin=10) jam <- sim2jam(sam,jd$pregam) diff -Nru mgcv-1.8-23/man/k.check.Rd mgcv-1.8-24/man/k.check.Rd --- mgcv-1.8-23/man/k.check.Rd 1970-01-01 00:00:00.000000000 +0000 +++ mgcv-1.8-24/man/k.check.Rd 2018-05-11 12:09:47.000000000 +0000 @@ -0,0 +1,54 @@ +\name{k.check} +\alias{k.check} +\title{Checking smooth basis dimension } +\description{ Takes a fitted \code{gam} object produced by \code{gam()} and runs +diagnostic tests of whether the basis dimension choises are adequate. +} +\usage{ +k.check(b, subsample=5000, n.rep=400) +} +\arguments{ + \item{b}{a fitted \code{gam} object as produced by \code{\link{gam}()}.} + \item{subsample}{above this number of data, testing uses a random sub-sample of data of this size.} + \item{n.rep}{how many re-shuffles to do to get p-value for k testing.} +} + +\value{A matrix contaning the output of the tests described above.} + +\details{ +The test of whether the basis dimension for a smooth is adequate (Wood, 2017, section 5.9) is based on computing an estimate of the residual variance based on differencing residuals that are near neighbours according to the (numeric) covariates of the smooth. This estimate divided by the residual variance is the \code{k-index} reported. The further below 1 this is, the more likely it is that there is missed pattern left in the residuals. The \code{p-value} is computed by simulation: the residuals are randomly re-shuffled \code{n.rep} times to obtain the null distribution of the differencing variance estimator, if there is no pattern in the residuals. For models fitted to more than \code{subsample} data, the tests are based of \code{subsample} randomly sampled data. Low p-values may indicate that the basis dimension, \code{k}, has been set too low, especially if the reported \code{edf} is close to \code{k\'}, the maximum possible EDF for the term. Note the disconcerting fact that if the test statistic itself is based on random resampling and the null is true, then the associated p-values will of course vary widely from one replicate to the next. Currently smooths of factor variables are not supported and will give an \code{NA} p-value. + +Doubling a suspect \code{k} and re-fitting is sensible: if the reported \code{edf} increases substantially then you may have been missing something in the first fit. Of course p-values can be low for reasons other than a too low \code{k}. See \code{\link{choose.k}} for fuller discussion. + +} + +\references{ + +Wood S.N. (2017) Generalized Additive Models: An Introduction with R (2nd edition). Chapman +and Hall/CRC Press. + +\url{http://www.maths.bris.ac.uk/~sw15190/} + +} +\author{ Simon N. Wood \email{simon.wood@r-project.org}} + +\seealso{ \code{\link{choose.k}}, \code{\link{gam}}, \code{\link{gam.check}}} + +\examples{ +library(mgcv) +set.seed(0) +dat <- gamSim(1,n=200) +b<-gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat) +plot(b,pages=1) +k.check(b) +} +\keyword{models} \keyword{smooth} \keyword{regression}%-- one or more ... + + + + + + + + + diff -Nru mgcv-1.8-23/man/linear.functional.terms.Rd mgcv-1.8-24/man/linear.functional.terms.Rd --- mgcv-1.8-23/man/linear.functional.terms.Rd 2017-07-24 15:04:11.000000000 +0000 +++ mgcv-1.8-24/man/linear.functional.terms.Rd 2018-05-11 12:09:47.000000000 +0000 @@ -31,11 +31,12 @@ will not be. Note also that for centred smooths it can be worth replacing the constant term in the model with \code{rowSums(L)} in order to ensure that predictions are automatically on the right scale. -Note that \code{\link{predict.gam}} can accept matrix predictors for prediction with such terms, in which case its +\code{\link{predict.gam}} can accept matrix predictors for prediction with such terms, in which case its \code{newdata} argument will need to be a list. However when predicting from the model it is not necessary to provide matrix covariate and \code{by} variable values. For example to simply examine the underlying smooth function one would use vectors of covariate values and vector \code{by} variables, with the \code{by} variable and equivalent of \code{L1}, above, set to vectors of ones. +The mechanism is usable with random effect smooths which take factor arguments, by using a trick to create a 2D array of factors. Simply create a factor vector containing the columns of the factor matrix stacked end to end (column major order). Then reset the dimensions of this vector to create the appropriate 2D array: the first dimension should be the number of response data and the second the number of columns of the required factor matrix. You can not use \code{matrix} or \code{data.matrix} to set up the required matrix of factor levels. See example below. } @@ -74,6 +75,36 @@ predict(b,data.frame(X=c(.2,.3,.7))) ###################################################################### +## Simple random effect model example. +## model: y[i] = f(x[i]) + b[k[i]] - b[j[i]] + e[i] +## k[i] and j[i] index levels of i.i.d. random effects, b. +###################################################################### + +set.seed(7) +n <- 200 +x <- runif(n) ## a continuous covariate + +## set up a `factor matrix'... +fac <- factor(sample(letters,n*2,replace=TRUE)) +dim(fac) <- c(n,2) + +## simulate data from such a model... +nb <- length(levels(fac)) +b <- rnorm(nb) +y <- 20*(x-.3)^4 + b[fac[,1]] - b[fac[,2]] + rnorm(n)*.5 + +L <- matrix(-1,n,2);L[,1] <- 1 ## the differencing 'by' variable + +mod <- gam(y ~ s(x) + s(fac,by=L,bs="re"),method="REML") +gam.vcomp(mod) +plot(mod,page=1) + +## example of prediction using matrices... +dat <- list(L=L[1:20,],fac=fac[1:20,],x=x[1:20],y=y[1:20]) +predict(mod,newdata=dat) + + +###################################################################### ## multivariate integral example. Function `test1' will be integrated# ## (by midpoint quadrature) over 100 equal area sub-squares covering # ## the unit square. Noise is added to the resulting simulated data. # diff -Nru mgcv-1.8-23/man/logLik.gam.Rd mgcv-1.8-24/man/logLik.gam.Rd --- mgcv-1.8-23/man/logLik.gam.Rd 2015-12-10 17:36:27.000000000 +0000 +++ mgcv-1.8-24/man/logLik.gam.Rd 2018-06-06 11:55:38.000000000 +0000 @@ -2,10 +2,10 @@ \alias{logLik.gam} \alias{AIC.gam} %- Also NEED an `\alias' for EACH other topic documented here. -\title{Log likelihood for a fitted GAM, for AIC} +\title{AIC and Log likelihood for a fitted GAM} \description{ Function to extract the log-likelihood for a fitted \code{gam} model (note that the models are usually fitted by penalized likelihood maximization). -Used by \code{\link{AIC}}. +Used by \code{\link{AIC}}. See details for more information on AIC computation. } \usage{ \method{logLik}{gam}(object,...) @@ -21,26 +21,46 @@ The function is provided so that \code{\link{AIC}} functions correctly with \code{gam} objects, and uses the appropriate degrees of freedom (accounting -for penalization). Note, when using \code{AIC} for penalized models, that the -degrees of freedom are the effective degrees of freedom and not the number of -parameters, and the model maximizes the penalized likelihood, not the actual -likelihood. (See e.g. Hastie and Tibshirani, 1990, section 6.8.3 and also Wood 2008), - -By default this routine uses a definition of the effective degrees of freedom that -includes smoothing parameter uncertainty, if this is available (i.e. if smoothing -parameter selection is by some variety of marginal likelihood). - +for penalization). See e.g. Wood, Pya and Saefken (2016) for a derivation of +an appropriate AIC. + +There are two possibile AIC's that might be considered for use with GAMs. Marginal +AIC is based on the marginal likelihood of the GAM, that is the likelihood based on +treating penalized (e.g. spline) coefficients as random and integrating them out. The +degrees of freedom is then the number of smoothing/variance parameters + the number +of fixed effects. The problem with Marginal AIC is that marginal likelihood +underestimates variance components/oversmooths, so that the approach favours simpler models +excessively (substituting REML does not work, because REML is not comparable between models +with different unpenalized/fixed components). Conditional AIC uses the likelihood of all +the model coefficients, evaluated at the penalized MLE. The degrees of freedom to use then +is the effective degrees of freedom for the model. However, Greven and Kneib (2010) show +that the neglect of smoothing parameter uncertainty can lead to this conditional AIC being +excessively likely to select larger models. Wood, Pya and Saefken (2016) propose a simple +correction to the effective degrees of freedom to fix this problem. \code{mgcv} applies this +correction whenever possible: that is when using \code{ML} or \code{REML} smoothing parameter +selection with \code{\link{gam}} or \code{\link{bam}}. The correction +is not computable when using the Extended Fellner Schall or BFGS optimizer (since the correction requires +an estimate of the covariance matrix of the log smoothing parameters). + + } \value{ Standard \code{logLik} object: see \code{\link{logLik}}. } -\references{Hastie and Tibshirani, 1990, Generalized Additive Models. +\references{ + +Greven, S., and Kneib, T. (2010), On the Behaviour of Marginal and +Conditional AIC in Linear Mixed Models, Biometrika, 97, 773-789. -Wood, S.N. (2008) Fast stable direct fitting and smoothness selection for -generalized additive models. J.R.Statist. Soc. B 70(3):495-518 +Wood, S.N., N. Pya and B. Saefken (2016), Smoothing parameter and +model selection for general smooth models (with discussion). +Journal of the American Statistical Association 111, 1548-1575 +\url{http://dx.doi.org/10.1080/01621459.2016.1180986} +Wood S.N. (2017) Generalized Additive Models: An Introduction with R +(2nd edition). Chapman and Hall/CRC Press. } diff -Nru mgcv-1.8-23/man/mgcv-parallel.Rd mgcv-1.8-24/man/mgcv-parallel.Rd --- mgcv-1.8-23/man/mgcv-parallel.Rd 2017-07-26 11:26:16.000000000 +0000 +++ mgcv-1.8-24/man/mgcv-parallel.Rd 2018-06-06 11:55:38.000000000 +0000 @@ -57,9 +57,9 @@ ## Poisson example on a cluster with 'bam'. ## Note that there is some overhead in initializing the ## computation on the cluster, associated with loading -## the Matrix package on each node. For this reason the -## sample sizes here are very small to keep CRAN happy, but at -## this low sample size you see little advantage of parallel computation. +## the Matrix package on each node. Sample sizes are low +## here to keep example quick -- for such a small model +## little or no advantage is likely to be seen. k <- 13;set.seed(9) dat <- gamSim(1,n=6000,dist="poisson",scale=.1) \donttest{ @@ -78,7 +78,7 @@ if (!is.null(cl)) stopCluster(cl) b3 } -## Alternative using the discrete option with bam... +## Alternative, better scaling example, using the discrete option with bam... system.time(b4 <- bam(y ~ s(x0,bs=bs,k=7)+s(x1,bs=bs,k=7)+s(x2,bs=bs,k=k) ,data=dat,family=poisson(),discrete=TRUE,nthreads=2)) diff -Nru mgcv-1.8-23/man/plot.gam.Rd mgcv-1.8-24/man/plot.gam.Rd --- mgcv-1.8-23/man/plot.gam.Rd 2017-10-31 11:25:14.000000000 +0000 +++ mgcv-1.8-24/man/plot.gam.Rd 2018-05-15 07:57:44.000000000 +0000 @@ -102,7 +102,8 @@ \item{seWithMean}{if \code{TRUE} the component smooths are shown with confidence intervals that include the uncertainty about the overall mean. If \code{FALSE} then the -uncertainty relates purely to the centred smooth itself. Marra and Wood (2012) suggests +uncertainty relates purely to the centred smooth itself. If \code{seWithMean=2} then the +intervals include the uncertainty in the mean of the fixed effects (but not in the mean of any uncentred smooths or random effects). Marra and Wood (2012) suggests that \code{TRUE} results in better coverage performance, and this is also suggested by simulation.} @@ -157,7 +158,7 @@ Note that, if \code{seWithMean=TRUE}, the confidence bands include the uncertainty about the overall mean. In other words although each smooth is shown centred, the confidence bands are obtained as if every other term in the model was constrained to have average 0, (average taken over the covariate values), except for the smooth concerned. This seems to correspond more closely to how most users interpret componentwise intervals in practice, and also results in intervals with -close to nominal (frequentist) coverage probabilities by an extension of Nychka's (1988) results presented in Marra and Wood (2012). +close to nominal (frequentist) coverage probabilities by an extension of Nychka's (1988) results presented in Marra and Wood (2012). There are two possible variants of this approach. In the default variant the extra uncertainty is in the mean of all other terms in the model (fixed and random, including uncentred smooths). Alternatively, if \code{seWithMean=2} then only the uncertainty in parametric fixed effects is included in the extra uncertainty (this latter option actually tends to lead to wider intervals when the model contains random effects). Several smooth plots methods using \code{\link{image}} will accept an \code{hcolors} argument, which can be anything documented in \code{\link{heat.colors}} (in which case something like \code{hcolors=rainbow(50)} is appropriate), or the \code{\link{grey}} function (in which case somthing like \code{hcolors=grey(0:50/50)} is needed). Another option is \code{contour.col} which will set the contour colour for some plots. These options are useful for producing grey scale pictures instead of colour. diff -Nru mgcv-1.8-23/man/predict.gam.Rd mgcv-1.8-24/man/predict.gam.Rd --- mgcv-1.8-23/man/predict.gam.Rd 2017-07-24 15:09:29.000000000 +0000 +++ mgcv-1.8-24/man/predict.gam.Rd 2018-05-15 07:57:44.000000000 +0000 @@ -16,7 +16,7 @@ \usage{ \method{predict}{gam}(object,newdata,type="link",se.fit=FALSE,terms=NULL, exclude=NULL,block.size=NULL,newdata.guaranteed=FALSE, - na.action=na.pass,unconditional=FALSE,...) + na.action=na.pass,unconditional=FALSE,iterms.type=NULL,...) } %- maybe also `usage' for other objects documented here. \arguments{ @@ -76,6 +76,8 @@ matrix is used, when available, otherwise the covariance matrix conditional on the estimated smoothing parameters is used. } +\item{iterms.type}{if \code{type="iterms"} then standard errors can either include the uncertainty in the overall mean (default, withfixed and random effects included) or the uncertainty in the mean of the non-smooth fixed effects only (\code{iterms.type=2}).} + \item{...}{ other arguments.} } diff -Nru mgcv-1.8-23/man/smooth.construct.ad.smooth.spec.Rd mgcv-1.8-24/man/smooth.construct.ad.smooth.spec.Rd --- mgcv-1.8-23/man/smooth.construct.ad.smooth.spec.Rd 2015-12-10 17:36:27.000000000 +0000 +++ mgcv-1.8-24/man/smooth.construct.ad.smooth.spec.Rd 2018-06-06 11:55:38.000000000 +0000 @@ -93,7 +93,7 @@ ## A 2D example (marked, 'Not run' purely to reduce ## checking load on CRAN). -\dontrun{ +\donttest{ par(mfrow=c(2,2),mar=c(1,1,1,1)) x <- seq(-.5, 1.5, length= 60) z <- x diff -Nru mgcv-1.8-23/man/smooth.construct.mrf.smooth.spec.Rd mgcv-1.8-24/man/smooth.construct.mrf.smooth.spec.Rd --- mgcv-1.8-23/man/smooth.construct.mrf.smooth.spec.Rd 2017-08-26 10:15:06.000000000 +0000 +++ mgcv-1.8-24/man/smooth.construct.mrf.smooth.spec.Rd 2018-05-11 12:09:47.000000000 +0000 @@ -62,8 +62,10 @@ } \item{nb}{is a named list defining the neighbourhood structure. \code{names(nb)} must correspond to the levels of the covariate of the smooth (i.e. the area labels), but can be in any order. \code{nb[[i]]} - is a vector indexing the neighbours of the ith area. All indices are relative to \code{nb} itself, but - can be translated using \code{names(nb)}. + is a numeric vector indexing the neighbours of the ith area. + All indices are relative to \code{nb} itself, but can be translated using \code{names(nb)}. See example code. + As an alternative each \code{nb[[i]]} can be an array of the names of the neighbours, but these will be + converted to the arrays of numeric indices internally. If no \code{penalty} is provided then it is computed automatically from this list. The ith row of the penalty matrix will be zero everwhere, except in the ith column, which will contain the number @@ -122,6 +124,22 @@ names(fv) <- as.character(columb$district) polys.plot(columb.polys,fv) +## Examine an example neighbourhood list - this one auto-generated from +## 'polys' above. + +nb <- b$smooth[[1]]$xt$nb +head(nb) +names(nb) ## these have to match the factor levels of the smooth +## look at the indices of the neighbours of the first entry, +## named '0'... +nb[['0']] ## by name +nb[[1]] ## same by index +## ... and get the names of these neighbours from their indices... +names(nb)[nb[['0']]] +b1 <- gam(crime ~ s(district,bs="mrf",k=20,xt=list(nb=nb))+s(income), + data=columb,method="REML") +b1 ## fit unchanged +plot(b1) ## but now there is no information with which to plot the mrf } \keyword{models} \keyword{regression}%-- one or more .. diff -Nru mgcv-1.8-23/MD5 mgcv-1.8-24/MD5 --- mgcv-1.8-23/MD5 2018-01-15 00:23:36.000000000 +0000 +++ mgcv-1.8-24/MD5 2018-06-18 19:07:59.000000000 +0000 @@ -1,37 +1,37 @@ -6e3790e8df181acf2ecf469373521368 *ChangeLog -a01208f1c73866153328f2ce262e28d9 *DESCRIPTION +3d3df9183a9b061dc8c4fce64fc30fef *ChangeLog +57abeb2a1390e7e8d3727fa3d69b589f *DESCRIPTION eb723b61539feef013de476e68b5c50a *GPL-2 -20feb98661e2c2d10bf2d3337af57cb3 *NAMESPACE -256ca3ddb2f799583b97d24ac136e579 *R/bam.r -28ef756f5a8c6bc10da15ad22c15eb1b *R/coxph.r -85f72f767420468e5d0a9b8608128607 *R/efam.r -276847b54ce19aea6c10d5922c31ea8c *R/fast-REML.r -f52b79e696006be12556df1140d6e294 *R/gam.fit3.r -374afe5d0d7441db1d823d239548a1b1 *R/gam.fit4.r +723a559e94082d3a7c70651cbcb08dd8 *NAMESPACE +6e5f0f0d0b69f7082e9ecd4aad1f1374 *R/bam.r +de69a45fe00e28a0309193df283c5829 *R/coxph.r +6c79693fe31558339cd694883d0beeb1 *R/efam.r +a0cc498ed5dca0d7909a504465592aa1 *R/fast-REML.r +253a2ac16043c512a1e7a13b097648e4 *R/gam.fit3.r +747d780473bb28492d5aafda9d4f72ba *R/gam.fit4.r 1b620b840ca67c9759639bd6e53824e3 *R/gam.sim.r f2368e22ccf048cf3d1e210e970013dd *R/gamlss.r -857d79084bc67dee97d412267d5cac44 *R/gamm.r +3dd7e563b5859efdee464aa1d762bad6 *R/gamm.r 10facb791e4cfd123d183f05660119c6 *R/jagam.r -1c500e2c478843eb16c967a2472e48f5 *R/mgcv.r +954b93360cb6d862f10a740c2e09424e *R/mgcv.r 2feca0dc9d354de7bc707c67a5891364 *R/misc.r 03772998ab05887f2eeae10dd6efe983 *R/mvam.r -2d0b7c4deaa2ac5d97dbc00fcf8ef395 *R/plots.r -694f20ac853e6cfa817bade3c6b1f518 *R/smooth.r +9702ee7e24809b4a3f0edfd41c97cd2e *R/plots.r +af5ee4fe12423c780babb13ceb94e595 *R/smooth.r 7398607a9ba7e85276bcf09df0d9344b *R/soap.r bde1774ce7903cabc57b3196f8872ea8 *R/sparse.r e468195a83fab90da8e760c2c3884bd3 *data/columb.polys.rda 40874e3ced720a596750f499ded8a60a *data/columb.rda e70536903ca327ade1496529ab817b60 *inst/CITATION -d0b290e7efd8b4c47a53dcde665a4d42 *inst/po/de/LC_MESSAGES/R-mgcv.mo -fe9d11e3087789da149e3688309df670 *inst/po/de/LC_MESSAGES/mgcv.mo -78e6bcd08b905ed2adb2ffac48034e06 *inst/po/en@quot/LC_MESSAGES/R-mgcv.mo -2dba1551f3581c06b157a558382686d8 *inst/po/en@quot/LC_MESSAGES/mgcv.mo -1f0edaff3abadad5b6cdc2439ebdeb01 *inst/po/fr/LC_MESSAGES/R-mgcv.mo -418bef2f2c1ed07bff6bbdb6884d2858 *inst/po/fr/LC_MESSAGES/mgcv.mo -b368d120586b31091055e8c177334087 *inst/po/ko/LC_MESSAGES/R-mgcv.mo -e6196a86ad3a8e42df84242a861d362a *inst/po/ko/LC_MESSAGES/mgcv.mo -a22ce06c4ec0dbf1f594a4796e5fa4ca *inst/po/pl/LC_MESSAGES/R-mgcv.mo -07e822258166c032ff9f1a4e96025841 *inst/po/pl/LC_MESSAGES/mgcv.mo +e43fa21d71e3a38fdf798e720aa8a7d1 *inst/po/de/LC_MESSAGES/R-mgcv.mo +0ba3c542c1242482f87e0b26fef1ef2a *inst/po/de/LC_MESSAGES/mgcv.mo +6b2f8048dca1b6bd5731d16ff622150e *inst/po/en@quot/LC_MESSAGES/R-mgcv.mo +71e2de6c331c21e49220b08caf2a3660 *inst/po/en@quot/LC_MESSAGES/mgcv.mo +4eebe3879f8b588432ea5725ad0bfb9c *inst/po/fr/LC_MESSAGES/R-mgcv.mo +6276c9e7d68c124f013fb4e057cfa362 *inst/po/fr/LC_MESSAGES/mgcv.mo +74b48701a0a5ef9e0a6013da67eb167f *inst/po/ko/LC_MESSAGES/R-mgcv.mo +6f2c8ab4d20af04822dc9bcb0ad4c567 *inst/po/ko/LC_MESSAGES/mgcv.mo +fdc7570ff0761a731464fad88b23c062 *inst/po/pl/LC_MESSAGES/R-mgcv.mo +8d3d346c7f6d142b940e9ab751e1db71 *inst/po/pl/LC_MESSAGES/mgcv.mo 1f716ff54bb49f75188f92b830b49428 *man/Beta.Rd 9d12d96a7f2dfe7faa1c112bf6631a8e *man/Predict.matrix.Rd 9c2573f0134dc2cbac7e11998e220558 *man/Predict.matrix.cr.smooth.Rd @@ -42,7 +42,7 @@ 60670020425f8749b81a8d8c3f168880 *man/Sl.setup.Rd 69ae63833438a3af2963e39482f1d72f *man/Tweedie.Rd 8087ab00d10b44c99c37f49bf90e19cd *man/anova.gam.Rd -4e6114b2f161710eb862d6b02e1c6870 *man/bam.Rd +cf0848f120b2d770ae6d9705b53dbbd6 *man/bam.Rd ab5e37c3bf8803de63b63c3bdc5909cd *man/bam.update.Rd cf5f1ee0aab639c7c4b9b357434f15b2 *man/bandchol.Rd 745cbf31eb14fc1c5916fc634c74d998 *man/bug.reports.mgcv.Rd @@ -51,7 +51,7 @@ c03748964ef606621418e428ae49b103 *man/columb.Rd 9906a83ce29a3b17044bc2a3c9940cee *man/concurvity.Rd 04d4285d6b0cea7f8b3f4cb7ec9a466c *man/coxph.Rd -a2350cf350407c4cfe5b0119265e63b3 *man/coxpht.Rd +fa4f9235186983c04d7d45f51adce210 *man/coxpht.Rd b78faf4ab9477183e7a3fbbd8801afeb *man/dDeta.Rd 0a6d4b3858cbb69a5d375ecd09282256 *man/exclude.too.far.Rd 4248593e3b2efd51e9501a0c845cb68d *man/extract.lme.cov.Rd @@ -62,9 +62,9 @@ 88888e966394c9f9792d9537341d053c *man/formula.gam.Rd 4da4d585b329769eb44f0c7a6e7dd554 *man/fs.test.Rd 6f405acde2d7b6f464cf45f5395113ba *man/full.score.Rd -1d56a971aa67782fa267f5c6f85b57ec *man/gam.Rd +370b3d285e928da33d4897a9a3345d24 *man/gam.Rd 42d669d0f18eba79234b2e849d724863 *man/gam.check.Rd -8931cd75ddec14d91ec94dec6ba69362 *man/gam.control.Rd +6d1a075aab054f1e14e6f0f1f432626a *man/gam.control.Rd afd2fdc49ac57b4b94ee233fa5da1d64 *man/gam.convergence.Rd 1cf5145859af2263f4e3459f40e1ab23 *man/gam.fit.Rd 4728be401da6eceb8b0c257377dc5d01 *man/gam.fit3.Rd @@ -84,24 +84,25 @@ 84d8e9331f7febe62c3b6055896357e6 *man/gamm.Rd 222535dd19201cfd929efd3305b13f43 *man/gaulss.Rd 398a5c12285401c1d37a8edb58780bc3 *man/get.var.Rd -a4ec15dc1e9e6a38c0738534faee0311 *man/gevlss.Rd +a62dd487f34f476f7f830ed9d1bc58dc *man/gevlss.Rd 39b47f30a7ea45382d62ca1753d876a8 *man/identifiability.Rd 4f96476abbf9692f52030d3859580a31 *man/in.out.Rd 6c33026ebb458483d34a04548c05d664 *man/inSide.Rd 2f222eeeb3d7bc42f93869bf8c2af58a *man/influence.gam.Rd 39b9de9dbac7d9dc5c849e1a37def675 *man/initial.sp.Rd 4e8db08a1b17e9cf5a0d05363eb0fc08 *man/interpret.gam.Rd -29f94d99b9a3decd4d71618eb839a7f7 *man/jagam.Rd +4bc4d96708fc6454ad81207299608d28 *man/jagam.Rd +d37e837db3089e3c0eb105669c04f0c8 *man/k.check.Rd 87d942b17bee05bb662270b894b183e6 *man/ldTweedie.Rd c7073b72336b0385080f2f4a40694416 *man/ldetS.Rd -f83af7cd9188210650479600b24ce654 *man/linear.functional.terms.Rd -93035193b0faa32700e1421ce8c1e9f6 *man/logLik.gam.Rd +1b314907562e9236747ec1e344ebe491 *man/linear.functional.terms.Rd +ab35592c0a29d1574579811ea1c6ec39 *man/logLik.gam.Rd b1c95a20afd6eb0825c00b46b8c3cbfa *man/ls.size.Rd 9a2c8f14c7a56eca69f4a59bef27a9bf *man/magic.Rd 5169af4be5fccf9fa79b6de08e9ea035 *man/magic.post.proc.Rd 5c4061016779a1504b6721cdf5182074 *man/mgcv-FAQ.Rd 894a7c1420d43c4dd32e0500809e28a4 *man/mgcv-package.Rd -05517492e962c5271d86135beee59b8a *man/mgcv-parallel.Rd +e85bd20fe881288da19e187c4c5d7a16 *man/mgcv-parallel.Rd 1f085fc302c7c0b10a44d59c439c3ec5 *man/mini.roots.Rd 8a89166312f624d58d79c1f86ae43e30 *man/missing.data.Rd 00ccf213c31910cd14f1df65a300eb33 *man/model.matrix.gam.Rd @@ -121,10 +122,10 @@ 8bc429d92aa9f58c4c43f2852e1f8123 *man/pdTens.Rd 1721f1b266d9e14827e8226e2cb74a81 *man/pen.edf.Rd 931c3aefb8b5e42aa230cfedd281bed1 *man/place.knots.Rd -ad49b46ad1751b09ec805b0f06f0e890 *man/plot.gam.Rd +8280e8aff6d5a004449d9e19661e3920 *man/plot.gam.Rd c27a6b886929b1dc83bf4b90cae848f9 *man/polys.plot.Rd 1a9d83c9fc67e5f0fc85d66d3112f4ef *man/predict.bam.Rd -6ea139c7a291c7dbf897a3f39afc97c0 *man/predict.gam.Rd +40056c77f064706e6933de405d2339be *man/predict.gam.Rd 41b1b0883f2419c8e2d2dd913fc7d677 *man/print.gam.Rd 6d0ce4e574fabceffdbedd46c91364cb *man/qq.gam.Rd 22b7dcbc8ff4096365fa98ce56b957c9 *man/rTweedie.Rd @@ -138,13 +139,13 @@ d54f4042e212fca7704cf8428bdaea38 *man/single.index.Rd 6f03e337d54221bc167d531e25af1eea *man/slanczos.Rd 8020154bd5c709d11f0e7cf043df886d *man/smooth.construct.Rd -4a689eba97e4fed138dccb8cad13205e *man/smooth.construct.ad.smooth.spec.Rd +3f3e0cd76b77e207ee5a6ff89e5f7a9f *man/smooth.construct.ad.smooth.spec.Rd fc7fba34b89fdf29f66744d1fdadda79 *man/smooth.construct.bs.smooth.spec.Rd 2f0463d1aca0b8798da6e681bd4c6e54 *man/smooth.construct.cr.smooth.spec.Rd f5e6d0f5122f61c336827b3615482157 *man/smooth.construct.ds.smooth.spec.Rd db75c958cbfb561914a3291ab58b9786 *man/smooth.construct.fs.smooth.spec.Rd 92591aadf25c362bed2b07da4adbd8be *man/smooth.construct.gp.smooth.spec.Rd -ba28e87c767445d260afa5e685821d73 *man/smooth.construct.mrf.smooth.spec.Rd +a7a3cb2c62724e7fea5edc94027fc097 *man/smooth.construct.mrf.smooth.spec.Rd 2523b6cefa306210c00f3477853b7f07 *man/smooth.construct.ps.smooth.spec.Rd b45d8e71bda4ceca8203dffea577e441 *man/smooth.construct.re.smooth.spec.Rd 119a26b7bb6cacc177cfd1507377a818 *man/smooth.construct.so.smooth.spec.Rd @@ -170,30 +171,30 @@ 281e73658c726997196727a99a4a1f9e *man/vis.gam.Rd cbb69f16706da27b44fc62c92dcae161 *man/ziP.Rd 14d41deaaee802a9e0a4f58cc9cc862d *man/ziplss.Rd -3c667c05c82f8b9823875c8574bd599a *po/R-de.po +12ca977278648b9e747f91e42e70991d *po/R-de.po 0bdfcf98961b0d52b60f806dc1dba77e *po/R-en@quot.po -56d12b1ebab87e8b1d44805d2228e785 *po/R-fr.po -32b67aab412c1ca8bd3dbbda60db15e6 *po/R-ko.po -315224c6239b535d101b19149740375b *po/R-mgcv.pot -9e941392e6ef12a9deb9e696db2d2523 *po/R-pl.po -8c33d89a914170dbc9f7c5fe598d2135 *po/de.po +80bfb00d13d6686374c0f6da4ecde2e9 *po/R-fr.po +ccbcb019a355ee59fcae8fa82b12bf2d *po/R-ko.po +7c3bd014826030a5d81998d4e95684a8 *po/R-mgcv.pot +30e8803024f1e12cf312b5ecb167b66d *po/R-pl.po +00918e54d5fc53e5cce4fe24d2536e89 *po/de.po 93f72334356fe6f05a64e567efd35c8e *po/en@quot.po -b3dfaf74ca2d76ca26eec986a14f5584 *po/fr.po -9116fc041ab458e49b3e498f8c0ac0d9 *po/ko.po -44b10768e6a0ef4e04c1e9859c882981 *po/mgcv.pot -ed7cb61912e4990cb0076d4cdcf11da8 *po/pl.po +0f7eef0207a1f659bdb4b620e20ffa42 *po/fr.po +8add409bed8f5b2b31a4bfa43cf95e31 *po/ko.po +b85b3ef1a39c4e1346b93173be8914aa *po/mgcv.pot +fdbb7d250e7baa7d73f26837246480f3 *po/pl.po 03972284b3400cf82cacd5d2dc4b8cb3 *src/Makevars -342aa30c8f6f1e99ffa2576a6f29d7ce *src/coxph.c +031c78f98f40e2615bf4794cb8fbae91 *src/coxph.c 0d723ffa162b4cb0c2c0fa958ccb4edd *src/discrete.c f6c4ba80ce1b71be7f4a44fac1b08c28 *src/gdi.c 2436f9b328e80370ce2203dbf1dd813c *src/general.h -3fc05fa48bda8202d05926014324404d *src/init.c +2a049d4a776ae2d109fe6f61eaa44d96 *src/init.c a9151b5236852eef9e6947590bfcf88a *src/magic.c 654ff83187dc0f7ef4e085f3348f70d2 *src/mat.c e4cef7f1753153fbab242d1c4d4f7e7f *src/matrix.c de37b0972199b796654405efc007f25b *src/matrix.h 8df4b96961491d76989b50856237ee2d *src/mgcv.c -4a5fe2fc83908d1b868b5dabcf7158ab *src/mgcv.h +09ec4af09981cab11312cc3d6f6dfc5f *src/mgcv.h 97e3717e95a70b1470b4c3071e144d17 *src/misc.c 465b8790ca2dfb6e8c5635cacabf5460 *src/mvn.c 563938b7bb6504ab10df5376c4360220 *src/qp.c diff -Nru mgcv-1.8-23/NAMESPACE mgcv-1.8-24/NAMESPACE --- mgcv-1.8-23/NAMESPACE 2017-11-15 09:23:11.000000000 +0000 +++ mgcv-1.8-24/NAMESPACE 2018-05-11 12:09:47.000000000 +0000 @@ -14,7 +14,7 @@ gaulss,gam.side,get.var,gevlss, influence.gam, in.out,inSide,interpret.gam,initial.sp, - jagam,ldetS, + jagam,k.check,ldetS, ldTweedie, logLik.gam,ls.size, magic, magic.post.proc, model.matrix.gam,mini.roots, diff -Nru mgcv-1.8-23/po/de.po mgcv-1.8-24/po/de.po --- mgcv-1.8-23/po/de.po 2016-09-13 09:10:23.000000000 +0000 +++ mgcv-1.8-24/po/de.po 2018-06-06 14:52:00.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: R 2.10.0 / mgcv 1.5-5\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-08-19 13:28+0100\n" +"POT-Creation-Date: 2018-06-06 15:48+0100\n" "PO-Revision-Date: 2009-10-08 16:16+0200\n" "Last-Translator: Chris Leick \n" "Language-Team: German \n" @@ -26,53 +26,40 @@ msgstr "" "magic, der gcv/ubre-Optimierer, konvergierte nach 400 Iterationen noch nicht." -#: matrix.c:80 +#: matrix.c:82 msgid "Failed to initialize memory for matrix." msgstr "Initialisieren von Speicher für Matrix fehlgeschlagen." -#: matrix.c:142 matrix.c:200 +#: matrix.c:144 matrix.c:202 msgid "An out of bound write to matrix has occurred!" msgstr "Ein Schreiben außerhalb der Matrixgrenze ist aufgetreten!" -#: matrix.c:148 +#: matrix.c:150 msgid "INTEGRITY PROBLEM in the extant matrix list." msgstr "INTEGRITÄTSPROBLEM in der bestehenden Matrix-Liste." -#: matrix.c:180 +#: matrix.c:182 msgid "You are trying to check matrix integrity without defining RANGECHECK." msgstr "" "Sie versuchen die Integrität der Matrix zu prüfen ohne RANGECHECK zu " "definieren." -#: matrix.c:238 +#: matrix.c:240 msgid "Target matrix too small in mcopy" msgstr "Zielmatrix zu klein in mcopy" -#: matrix.c:258 matrix.c:266 matrix.c:279 matrix.c:287 +#: matrix.c:260 matrix.c:268 matrix.c:281 matrix.c:289 msgid "Incompatible matrices in matmult." msgstr "Inkompatible Matrizen in matmult." -#: matrix.c:374 +#: matrix.c:313 msgid "Attempt to invert() non-square matrix" msgstr "Versuch des Aufrufs von invert() für nicht-quadratische Matrix" -#: matrix.c:396 +#: matrix.c:335 msgid "Singular Matrix passed to invert()" msgstr "Singuläre Matrix an invert() übergeben" -#: matrix.c:1316 -msgid "svd() not converged" -msgstr "svd() nicht konvergiert" - -#: matrix.c:1392 -#, c-format -msgid "svdroot matrix not +ve semi def. %g" -msgstr "svdroot-Matrix nicht +ve def. %g" - -#: matrix.c:1420 -msgid "Sort failed" -msgstr "Sortieren fehlgeschlagen" - #: qp.c:59 msgid "ERROR in addconQT." msgstr "FEHLER in addconQT." @@ -92,3 +79,12 @@ msgstr "" "Ein Term hat weniger einzigartige Kombinationen von Kovariaten als maximal " "angegebene Freiheitsgrade" + +#~ msgid "svd() not converged" +#~ msgstr "svd() nicht konvergiert" + +#~ msgid "svdroot matrix not +ve semi def. %g" +#~ msgstr "svdroot-Matrix nicht +ve def. %g" + +#~ msgid "Sort failed" +#~ msgstr "Sortieren fehlgeschlagen" diff -Nru mgcv-1.8-23/po/fr.po mgcv-1.8-24/po/fr.po --- mgcv-1.8-23/po/fr.po 2016-09-13 09:10:23.000000000 +0000 +++ mgcv-1.8-24/po/fr.po 2018-06-06 14:52:00.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mgcv 1.3-10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-08-19 13:28+0100\n" +"POT-Creation-Date: 2018-06-06 15:48+0100\n" "PO-Revision-Date: 2005-12-08 00:40+0100\n" "Last-Translator: Philippe Grosjean \n" "Language-Team: French \n" @@ -25,53 +25,40 @@ msgid "magic, the gcv/ubre optimizer, failed to converge after 400 iterations." msgstr "magic, l'optimisateur gcv/ubre, n'a pas converg aprs 400 itrations." -#: matrix.c:80 +#: matrix.c:82 msgid "Failed to initialize memory for matrix." msgstr "L'initialisation de la mmoire pour une matrice a chou." -#: matrix.c:142 matrix.c:200 +#: matrix.c:144 matrix.c:202 msgid "An out of bound write to matrix has occurred!" msgstr "Une crite hors des limites de la matrice s'est produite !" -#: matrix.c:148 +#: matrix.c:150 msgid "INTEGRITY PROBLEM in the extant matrix list." msgstr "PROBLEME D'INTEGRITE dans la liste de la matrice tendue." -#: matrix.c:180 +#: matrix.c:182 msgid "You are trying to check matrix integrity without defining RANGECHECK." msgstr "" "Vous essayez de vrifier l'intgrit de la matrice sans avoir dfini " "RANGECHECK." -#: matrix.c:238 +#: matrix.c:240 msgid "Target matrix too small in mcopy" msgstr "Matrice cible trop petite dans mcopy" -#: matrix.c:258 matrix.c:266 matrix.c:279 matrix.c:287 +#: matrix.c:260 matrix.c:268 matrix.c:281 matrix.c:289 msgid "Incompatible matrices in matmult." msgstr "Matrices incompatibles dans matmult." -#: matrix.c:374 +#: matrix.c:313 msgid "Attempt to invert() non-square matrix" msgstr "Tentative d'inversion d'une matrice non carre" -#: matrix.c:396 +#: matrix.c:335 msgid "Singular Matrix passed to invert()" msgstr "Matrice singulire passe invert()" -#: matrix.c:1316 -msgid "svd() not converged" -msgstr "svd() n'a pas converg" - -#: matrix.c:1392 -#, c-format -msgid "svdroot matrix not +ve semi def. %g" -msgstr "la matrice svdroot n'est pas +ve semi def. %g" - -#: matrix.c:1420 -msgid "Sort failed" -msgstr "Le tri a chou" - #: qp.c:59 msgid "ERROR in addconQT." msgstr "ERREUR dans addconQT." @@ -91,3 +78,12 @@ msgstr "" "Un terme a moins de combinaisons de covariables uniques que le degr de " "libert maximum spcifi" + +#~ msgid "svd() not converged" +#~ msgstr "svd() n'a pas converg" + +#~ msgid "svdroot matrix not +ve semi def. %g" +#~ msgstr "la matrice svdroot n'est pas +ve semi def. %g" + +#~ msgid "Sort failed" +#~ msgstr "Le tri a chou" diff -Nru mgcv-1.8-23/po/ko.po mgcv-1.8-24/po/ko.po --- mgcv-1.8-23/po/ko.po 2016-09-13 09:10:23.000000000 +0000 +++ mgcv-1.8-24/po/ko.po 2018-06-06 14:52:00.000000000 +0000 @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: mgcv 1.8-4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-08-19 13:28+0100\n" +"POT-Creation-Date: 2018-06-06 15:48+0100\n" "PO-Revision-Date: 2015-02-21 16:01-0600\n" "Last-Translator:Chel Hee Lee \n" "Language-Team: Chel Hee Lee \n" @@ -29,51 +29,38 @@ msgid "magic, the gcv/ubre optimizer, failed to converge after 400 iterations." msgstr "" -#: matrix.c:80 +#: matrix.c:82 msgid "Failed to initialize memory for matrix." msgstr "행렬생성에 필요한 메모리 초기화에 실패했습니다." -#: matrix.c:142 matrix.c:200 +#: matrix.c:144 matrix.c:202 msgid "An out of bound write to matrix has occurred!" msgstr "" -#: matrix.c:148 +#: matrix.c:150 msgid "INTEGRITY PROBLEM in the extant matrix list." msgstr "" -#: matrix.c:180 +#: matrix.c:182 msgid "You are trying to check matrix integrity without defining RANGECHECK." msgstr "" -#: matrix.c:238 +#: matrix.c:240 msgid "Target matrix too small in mcopy" msgstr "" -#: matrix.c:258 matrix.c:266 matrix.c:279 matrix.c:287 +#: matrix.c:260 matrix.c:268 matrix.c:281 matrix.c:289 msgid "Incompatible matrices in matmult." msgstr "" -#: matrix.c:374 +#: matrix.c:313 msgid "Attempt to invert() non-square matrix" msgstr "" -#: matrix.c:396 +#: matrix.c:335 msgid "Singular Matrix passed to invert()" msgstr "특이함수(singular matrix)가 invert()에 전달되었습니다." -#: matrix.c:1316 -msgid "svd() not converged" -msgstr "" - -#: matrix.c:1392 -#, c-format -msgid "svdroot matrix not +ve semi def. %g" -msgstr "" - -#: matrix.c:1420 -msgid "Sort failed" -msgstr "정렬에 실패했습니다." - #: qp.c:59 msgid "ERROR in addconQT." msgstr "addconQT 에서 에러가 발생했습니다." @@ -91,3 +78,6 @@ "A term has fewer unique covariate combinations than specified maximum " "degrees of freedom" msgstr "" + +#~ msgid "Sort failed" +#~ msgstr "정렬에 실패했습니다." diff -Nru mgcv-1.8-23/po/mgcv.pot mgcv-1.8-24/po/mgcv.pot --- mgcv-1.8-23/po/mgcv.pot 2017-07-24 13:17:00.000000000 +0000 +++ mgcv-1.8-24/po/mgcv.pot 2018-06-06 14:52:00.000000000 +0000 @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: mgcv 1.8-18\n" +"Project-Id-Version: mgcv 1.8-24\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-07-24 10:46+0100\n" +"POT-Creation-Date: 2018-06-06 15:48+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,51 +25,38 @@ msgid "magic, the gcv/ubre optimizer, failed to converge after 400 iterations." msgstr "" -#: matrix.c:80 +#: matrix.c:82 msgid "Failed to initialize memory for matrix." msgstr "" -#: matrix.c:142 matrix.c:200 +#: matrix.c:144 matrix.c:202 msgid "An out of bound write to matrix has occurred!" msgstr "" -#: matrix.c:148 +#: matrix.c:150 msgid "INTEGRITY PROBLEM in the extant matrix list." msgstr "" -#: matrix.c:180 +#: matrix.c:182 msgid "You are trying to check matrix integrity without defining RANGECHECK." msgstr "" -#: matrix.c:238 +#: matrix.c:240 msgid "Target matrix too small in mcopy" msgstr "" -#: matrix.c:258 matrix.c:266 matrix.c:279 matrix.c:287 +#: matrix.c:260 matrix.c:268 matrix.c:281 matrix.c:289 msgid "Incompatible matrices in matmult." msgstr "" -#: matrix.c:374 +#: matrix.c:313 msgid "Attempt to invert() non-square matrix" msgstr "" -#: matrix.c:396 +#: matrix.c:335 msgid "Singular Matrix passed to invert()" msgstr "" -#: matrix.c:1316 -msgid "svd() not converged" -msgstr "" - -#: matrix.c:1392 -#, c-format -msgid "svdroot matrix not +ve semi def. %g" -msgstr "" - -#: matrix.c:1420 -msgid "Sort failed" -msgstr "" - #: qp.c:59 msgid "ERROR in addconQT." msgstr "" diff -Nru mgcv-1.8-23/po/pl.po mgcv-1.8-24/po/pl.po --- mgcv-1.8-23/po/pl.po 2016-09-13 09:10:23.000000000 +0000 +++ mgcv-1.8-24/po/pl.po 2018-06-06 14:52:00.000000000 +0000 @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: mgcv 1.7-28\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-08-19 13:28+0100\n" +"POT-Creation-Date: 2018-06-06 15:48+0100\n" "PO-Revision-Date: 2014-03-24 17:59+0100\n" "Last-Translator: Łukasz Daniel \n" "Language-Team: Łukasz Daniel \n" @@ -32,7 +32,7 @@ # mgcv/src/matrix.c: 85 # (_("Failed to initialize memory for matrix."),1) -#: matrix.c:80 +#: matrix.c:82 msgid "Failed to initialize memory for matrix." msgstr "Nie udało się zainicjalizować pamięci dla macierzy." @@ -40,25 +40,25 @@ # (_("An out of bound write to matrix has occurred!"),1) # mgcv/src/matrix.c: 210 # (_("An out of bound write to matrix has occurred!"),1) -#: matrix.c:142 matrix.c:200 +#: matrix.c:144 matrix.c:202 msgid "An out of bound write to matrix has occurred!" msgstr "Nastąpił zapis poza zakresem macierzy!" # mgcv/src/matrix.c: 153 # (_("INTEGRITY PROBLEM in the extant matrix list."),1) -#: matrix.c:148 +#: matrix.c:150 msgid "INTEGRITY PROBLEM in the extant matrix list." msgstr "PROBLEM SPÓJNOŚCI w istniejącej liście macierzy." # mgcv/src/matrix.c: 186 # (_("You are trying to check matrix integrity without defining RANGECHECK.")) -#: matrix.c:180 +#: matrix.c:182 msgid "You are trying to check matrix integrity without defining RANGECHECK." msgstr "Próbujesz sprawdzić integralność macierzy bez określania 'RANGECHECK'" # mgcv/src/matrix.c: 248 # (_("Target matrix too small in mcopy"),1) -#: matrix.c:238 +#: matrix.c:240 msgid "Target matrix too small in mcopy" msgstr "Docelowa macierz jest zbyt mała, aby wykonać 'mcopy'" @@ -70,41 +70,22 @@ # (_("Incompatible matrices in matmult."),1) # mgcv/src/matrix.c: 297 # (_("Incompatible matrices in matmult."),1) -#: matrix.c:258 matrix.c:266 matrix.c:279 matrix.c:287 +#: matrix.c:260 matrix.c:268 matrix.c:281 matrix.c:289 msgid "Incompatible matrices in matmult." msgstr "Niespójne macierze w 'matmult'." # mgcv/src/matrix.c: 384 # (_("Attempt to invert() non-square matrix"),1) -#: matrix.c:374 +#: matrix.c:313 msgid "Attempt to invert() non-square matrix" msgstr "Próba odwrócenia metodą 'invert()' niekwadratowej macierzy" # mgcv/src/matrix.c: 406 # (_("Singular Matrix passed to invert()"),1) -#: matrix.c:396 +#: matrix.c:335 msgid "Singular Matrix passed to invert()" msgstr "Przekazano osobliwą macierz do 'invert()'" -# mgcv/src/matrix.c: 1327 -# (_("svd() not converged"),1) -#: matrix.c:1316 -msgid "svd() not converged" -msgstr "'svd()' nie uzbieżnił się" - -# mgcv/src/matrix.c: 1403 -# sprintf(err,_("svdroot matrix not +ve semi def. %g"),w.V[i]*w.V[i]) -#: matrix.c:1392 -#, c-format -msgid "svdroot matrix not +ve semi def. %g" -msgstr "macierz 'svdroot' nie jest dodatnio określona %g" - -# mgcv/src/matrix.c: 1431 -# (_("Sort failed"),1) -#: matrix.c:1420 -msgid "Sort failed" -msgstr "Sortowanie nie powiodło się" - # mgcv/src/qp.c: 60 # (_("ERROR in addconQT."),1) #: qp.c:59 @@ -139,3 +120,18 @@ msgstr "" "Człon posiada mniej unikalnych kombinacji zmiennych niezależnych niż " "określona maksymalna liczba stopni swobody" + +# mgcv/src/matrix.c: 1327 +# (_("svd() not converged"),1) +#~ msgid "svd() not converged" +#~ msgstr "'svd()' nie uzbieżnił się" + +# mgcv/src/matrix.c: 1403 +# sprintf(err,_("svdroot matrix not +ve semi def. %g"),w.V[i]*w.V[i]) +#~ msgid "svdroot matrix not +ve semi def. %g" +#~ msgstr "macierz 'svdroot' nie jest dodatnio określona %g" + +# mgcv/src/matrix.c: 1431 +# (_("Sort failed"),1) +#~ msgid "Sort failed" +#~ msgstr "Sortowanie nie powiodło się" diff -Nru mgcv-1.8-23/po/R-de.po mgcv-1.8-24/po/R-de.po --- mgcv-1.8-23/po/R-de.po 2017-07-24 13:17:00.000000000 +0000 +++ mgcv-1.8-24/po/R-de.po 2018-06-06 14:52:00.000000000 +0000 @@ -6,10 +6,10 @@ # msgid "" msgstr "" -"Project-Id-Version: R 3.2.0 / mgcv 1.8-5\n" +"Project-Id-Version: R 3.4.4 / mgcv 1.8-23\n" "Report-Msgid-Bugs-To: bugs@r-project.org\n" -"POT-Creation-Date: 2017-07-24 10:46\n" -"PO-Revision-Date: 2015-03-26 13:29+0100\n" +"POT-Creation-Date: 2018-06-06 15:48\n" +"PO-Revision-Date: 2018-04-06 11:44+0200\n" "Last-Translator: Detlef Steuer \n" "Language-Team: R-Core \n" "Language: de\n" @@ -19,14 +19,14 @@ "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "bam can not discretize with this nesting structure" -msgstr "" - -msgid "discretization can not handle smooth ids" -msgstr "" +msgstr "bam kann in dieser Schachtelungsstruktur nicht disketisieren" msgid "'family' argument seems not to be a valid family object" msgstr "'family' Argument scheint kein zulässiges family Objekt zu sein" +msgid "This family should not have a matrix response" +msgstr "" + msgid "cannot find valid starting values: please specify some" msgstr "Kann keine gültigen Startwerte finden: Bitte geben Sie einige an" @@ -52,37 +52,41 @@ "Es trat der Fall auf, dass die angepassten Quoten numerisch 0 oder 1 waren" msgid "Too many cluster nodes to use all efficiently" -msgstr "" +msgstr "Zu viele Cluster-Knoten, um alle effizient zu nutzen" -#, fuzzy msgid "iterms reset to terms" -msgstr "Unbekannter Typ, wird auf terms zurückgesetzt." +msgstr "iterms auf terms zurückgesetzt." msgid "exclude ignored by discrete prediction at present" -msgstr "" +msgstr "zur Zeit wird bei diskreter Prädiktion exclude ignoriert" msgid "family not recognized" msgstr "family nicht erkannt" -msgid "extended families not supported by bam" -msgstr "" +#, fuzzy +msgid "general families not supported by bam" +msgstr "erweiterte Familien nicht von bam unterstützt" msgid "un-supported smoothness selection method" msgstr "nicht unterstützte Methode zur Glattheitswahl" msgid "discretization only available with fREML" -msgstr "" +msgstr "Diskretisierung nur mit fREML verfügbar" msgid "discrete method does not use parallel cluster - use nthreads instead" msgstr "" +"diskrete Methode nutzt keinen parallelen Cluster - nutze besser nthreads" msgid "openMP not available: single threaded computation only" -msgstr "" +msgstr "openMP nicht verfügbar: nur single thread Berechnungen" msgid "min.sp not supported with fast REML computation, and ignored." msgstr "" "min.sp wird bei schneller REML Berechnung nicht unterstützt und ignoriert." +msgid "no smooths, ignoring `discrete=TRUE'" +msgstr "" + msgid "Not enough (non-NA) data to do anything meaningful" msgstr "Nicht genug (nicht-NA-) Daten, um etwas Sinnvolles zu tun" @@ -92,9 +96,8 @@ msgid "chunk.size < number of coefficients. Reset to %d" msgstr "chunk.size < number of coefficients. Zurückgesetzt auf %d" -#, fuzzy msgid "unknown tensor constraint type" -msgstr "nicht implementierter dünn besetzter Nebenbedingungstyp verlangt" +msgstr "unbekannte Typ von Tensor-Einschränkungen" msgid "Model has more coefficients than data" msgstr "Modell hat mehr Koeffizienten als Daten" @@ -112,10 +115,18 @@ msgstr "" "Link nicht verfügbar für die coxph Familie; \"identity\" Link ist verfügbar" +#, fuzzy +msgid "something wrong with stratified prediction" +msgstr "etwas stimmt nicht mit Argument d." + msgid "NA times supplied for cox.ph prediction" msgstr "NA Zeiten für die coxph Vorhersage angegeben" -msgid "cox.ph does not yet handle offsets" +#, fuzzy +msgid "not an extended family" +msgstr "Link nicht implementiert für erweiterte Familien" + +msgid "step failure in theta estimation" msgstr "" msgid "" @@ -129,7 +140,7 @@ msgstr "theta oder R müssen an ocat übergeben werden" msgid "Response should be integer class labels" -msgstr "" +msgstr "Antwort sollten ganzzahlige Klassenlabel sein" msgid "values out of range" msgstr "Werte außerhalb des zulässigen Bereichs" @@ -167,9 +178,8 @@ "Link nicht verfügbar für die skalierte t-Verteilung; verfügbare Links sind " "\"identity\", \"log\" und \"inverse\"" -#, fuzzy -msgid "scaled t df must be > min.df" -msgstr "skalierte t df müssen >2 sein" +msgid "Supplied df below min.df. min.df reset" +msgstr "" msgid "NA values not allowed for the scaled t family" msgstr "NA Werte für die skalierte t-Verteilung nicht zulässig" @@ -196,7 +206,7 @@ "keinen Sinn" msgid "Possible divergence detected in fast.REML.fit" -msgstr "" +msgstr "Mögliche Divergenz entdeckt in fast.REML.fit" msgid "fast REML optimizer reached iteration limit" msgstr "schneller REML Optimierer erreichte max. Iterationszahl" @@ -302,9 +312,10 @@ msgid "Fitting terminated with step failure - check results carefully" msgstr "" +"Anpassung beendet mit Schrittweitenfehler - Ergebnisse sorgfältig prüfen" msgid "Iteration limit reached without full convergence - check carefully" -msgstr "" +msgstr "Iterationsgrenze erreicht ohne volle Konvergenz -- sorgfältig prüfen" msgid "link not implemented for extended families" msgstr "Link nicht implementiert für erweiterte Familien" @@ -357,7 +368,7 @@ msgstr "y muss für Tweedie(p=1) ein ganzzahliges Vielfaches von phi sein" msgid "all.derivs only available in rho, theta parameterization" -msgstr "" +msgstr "all.derivs nur in der rho, theta Parametrisierung verfügbar" msgid "Only 1 0 sein" +msgstr "Anzahl von Kategorien muss mindestens 2 sein" -#, fuzzy msgid "number of linear predictors doesn't match" -msgstr "falsche Anzahl linearer Prädiktoren für diese Familie" +msgstr "Anzahl linearer Prädiktoren passt nicht" msgid "response not in 0 to number of predictors + 1" -msgstr "" +msgstr "Antwort ist nicht zwischen 0 und Zahl der Prädiktoren + 1" msgid "ziplss requires 2 links specified as character strings" msgstr "ziplss verlangt 2 Links, angegeben als Zeichenketten" @@ -431,9 +443,8 @@ msgid "Using ziplss for binary data makes no sense" msgstr "Gebrauch von ziplss bei binären Daten ergibt keinen Sinn" -#, fuzzy msgid "gevlss requires 3 links specified as character strings" -msgstr "gaulss verlangt 2 Links, angegeben als Zeichenketten" +msgstr "gevlss verlangt 3 Links, angegeben als Zeichenketten" msgid "An object of length %d does not match the required parameter size" msgstr "" @@ -523,11 +534,10 @@ msgstr "gamm ist nicht konvergiert, versuche niterPQL zu erhöhen" msgid "family are not designed for use with gamm!" -msgstr "" +msgstr "Familie nicht entworfen, um mit gamm genutzt zu werden" -#, fuzzy msgid "gamm is not designed to use extended families" -msgstr "Link nicht implementiert für erweiterte Familien" +msgstr "gamm ist nicht entworfen, um erweiterte Familien zu nutzen" # R/gamm.r msgid "random argument must be a *named* list." @@ -646,16 +656,14 @@ msgstr "Modellmatrix hat keinen vollen Spaltenrang" msgid "can't handle [[ in formula" -msgstr "" +msgstr "kann mit [[ in Formel nicht umgehen" # http://de.wikipedia.org/wiki/Prädiktor -#, fuzzy msgid "single linear predictor indices are ignored" -msgstr "Ungültige Werte des linearen Prädiktors in leerem Modell" +msgstr "einzelne Indizes linearer Prädiktoren werden ignoriert" -#, fuzzy msgid "linear predictor labels out of range" -msgstr "Werte außerhalb des zulässigen Bereichs" +msgstr "Labels des linearen Prädiktors außerhalb des zulässigen Bereichs" msgid "model has repeated 1-d smooths of same variable." msgstr "Modell hat 1-d-Glättungen derselben Variable wiederholt." @@ -688,13 +696,13 @@ msgstr "absorb.cons muss für multi-formel Modelle TRUE sein" msgid "length(drop.intercept) should be equal to number of model formulas" -msgstr "" +msgstr "length(drop.intercept) sollte gleich der Zahl der model.formulas sein" msgid "shared offsets not allowed" -msgstr "" +msgstr "gemeinsame Offsets nicht erlaubt" msgid "dropping unidentifiable parametric terms from model" -msgstr "" +msgstr "entferne unidentifizierbar parametrische Terme aus dem Modell" msgid "First argument is no sort of formula!" msgstr "Erstes Argument ist keine Art von Formel" @@ -731,12 +739,8 @@ msgid "unknown outer optimization method." msgstr "Unbekannte äußere Optimierungsmethode" -#, fuzzy -msgid "Extended Fellner Schall only implemented for general families" -msgstr "Link nicht implementiert für erweiterte Familien" - msgid "Please provide a single value for theta or use nb to estimate it" -msgstr "" +msgstr "Bitte einzelnen Wert für theta angeben oder nb nutzen, um zu schätzen" msgid "nlm.fd only available for GCV/UBRE" msgstr "nlm.fd nur verfügbar für GCV/UBRE" @@ -757,7 +761,7 @@ msgstr "falsche Anzahl linearer Prädiktoren für diese Familie" msgid "edge.correct must be logical or a positive number" -msgstr "" +msgstr "edge.correct muss Wahrheitswert oder eine positive Zahl sein" msgid "nthreads must be a positive integer" msgstr "nthreads muss eine positive, ganze Zahl sein" @@ -805,12 +809,11 @@ msgid "`object' is not of class \"gam\"" msgstr "'object' ist nicht aus der Klasse \"gam\"" -#, fuzzy msgid "unrecognised na.action" -msgstr "unerkannter (Vektor?) Verweis" +msgstr "unerkannter ba.action" msgid "na.action not character or function" -msgstr "" +msgstr "na.action ist weder Zeichenkette noch Funktion" msgid "Smoothness uncertainty corrected covariance not available" msgstr "Glattheitsunsicherheits-korrigierte Kovarianz ist nicht verfügbar" @@ -827,6 +830,10 @@ msgstr "" "newdata ist ein model.frame: Es soll alle benötigten Variablen enthalten" +#, fuzzy +msgid "no NAs allowed in response data for this model" +msgstr "nichts zu tun für dieses Modell" + msgid "not all required variables have been supplied in newdata!" msgstr "nicht alle benötigten Variablen wurden in newdata angegeben!" @@ -836,9 +843,8 @@ msgid "non-existent terms requested - ignoring" msgstr "nicht existierende Terme angefordert - wird ignoriert" -#, fuzzy msgid "non-existent exclude terms requested - ignoring" -msgstr "nicht existierende Terme angefordert - wird ignoriert" +msgstr "nicht existierende Ausschluss-Terme angefordert - wird ignoriert" msgid "requires an object of class gam" msgstr "verlangt ein Objekt der Klasse gam" @@ -862,15 +868,6 @@ msgid "m can't be in re" msgstr "m kann nicht in re sein" -msgid "p-values may give low power in some circumstances" -msgstr "p-Werte können unter Umständen geringere Power geben" - -msgid "p-values un-reliable" -msgstr "p-Werte unzuverlässig" - -msgid "p-values may give very low power" -msgstr "p-Werte geben evtl. sehr geringe Power" - msgid "" "p-values for any terms that can be penalized to zero will be unreliable: " "refit model to fix this." @@ -878,9 +875,6 @@ "Die p-Werte für einen Term, der auf Null bestraft werden kann, sind " "unzuverlässig: Modell wird neu angepasst, um dies zu korrigieren." -msgid "p.type!=0 is deprecated, and liable to be removed in future" -msgstr "p.type!=0 ist veraltet und wird in der Zukunft entfernt" - msgid "The following arguments to anova.glm(..) are invalid and dropped:" msgstr "Die folgenden Argumente für anova.glm(..) sind ungültig und entfallen:" @@ -888,7 +882,7 @@ msgstr "," msgid "un-supported test" -msgstr "" +msgstr "nicht unterstützter Test" msgid "test argument ignored" msgstr "Argument test ignoriert" @@ -904,6 +898,7 @@ msgid "S.scale vector doesn't match S list - please report to maintainer" msgstr "" +"S.scale Vektor passt nicht zu S Liste - bitte den Maintainer informieren!" msgid "Supplied matrix not symmetric" msgstr "Angegebene Matrix nicht symmetrisch" @@ -929,25 +924,23 @@ msgid "X lost dimensions in magic!!" msgstr "X verlor Dimensionen in magic!!" -#, fuzzy msgid "mu dimensions wrong" -msgstr "Dimension von fx ist falsch" +msgstr "mu Dimensionen falsch" -#, fuzzy msgid "something wrong with inputs to LAPACK routine" -msgstr "Etwas stimmt nicht mit der automatischen Straftermkonstruktion" +msgstr "Etwas ist falsch mit den Eingaben für LAPACK routine" msgid "not positive definite" -msgstr "" +msgstr "nicht positiv definit" msgid "don't be silly" -msgstr "" +msgstr "sei nicht dumm" msgid "sd should have exactly one less entry than ld" -msgstr "" +msgstr "sd sollte genau eins kleiner sein als ld" msgid "internal error in vcorr, please report to simon.wood@r-project.org" -msgstr "" +msgstr "interner Fehler in vcorr, bitte an simon.wood@r-project.org melden" msgid "a has wrong number of rows" msgstr "a hat die falsche Zeilenzahl" @@ -956,10 +949,10 @@ msgstr "mvn benötigt zwei- oder höherdimensionale Daten" msgid "mvn does not yet handle offsets" -msgstr "" +msgstr "mvn kann noch nicht mit Offsets umgehen" msgid "mvn dimension error" -msgstr "" +msgstr "mvn Dimensionsfehler" msgid "object is not a glm or gam" msgstr "Obejekt ist weder glm noch gam" @@ -978,9 +971,13 @@ msgstr "" "keine automatische Darstellung für Glättungen von mehr als zwei Variablen" -msgid "no automatic plotting for smooths of more than one variable" +#, fuzzy +msgid "no automatic plotting for smooths of more than four variables" +msgstr "" +"keine automatische Darstellung für Glättungen von mehr als zwei Variablen" + +msgid "argument pers is deprecated, please use scheme instead" msgstr "" -"keine automatische Darstellung für Glättungen von mehr als einer Variable" msgid "residuals argument to plot.gam is wrong length: ignored" msgstr "Residuen-Argument für plot.gam hat falsche Länge: Ignoriert" @@ -1040,7 +1037,7 @@ msgstr "x ist Null" msgid "uniquecombs has not worked properly" -msgstr "" +msgstr "uniquecombs hat nicht richtig gearbeitet" msgid "order too low" msgstr "Ordnung zu klein" @@ -1077,7 +1074,7 @@ msgstr "nur das erste Element von 'id' wird genutzt" msgid "supply a value for each variable for a point constraint" -msgstr "" +msgstr "bitte für jede Variable einen Wert angeben bei Punktbeschränkungen" msgid "ord is wrong. reset to NULL." msgstr "ord ist falsch, wird auf NULL zurückgesetzt" @@ -1089,9 +1086,8 @@ msgid "by=. not allowed" msgstr "by=. nicht erlaubt" -#, fuzzy msgid "s(.) not supported." -msgstr "s(.) wird noch nicht unterstützt." +msgstr "s(.) wird nicht unterstützt." msgid "s(.) not yet supported." msgstr "s(.) wird noch nicht unterstützt." @@ -1111,15 +1107,8 @@ msgid "reparameterization unstable for margin: not done" msgstr "Reparametrisierung für den Rand instabil: nicht durchgeführt" -msgid "" -"single penalty tensor product smooths are deprecated and likely to be " -"removed soon" -msgstr "" -"Tensorprodukt-Glätter mit einfachem Strafterm sind veraltet und werden " -"wahrscheinlich bald entfernt" - msgid "basis not usable with reduced te" -msgstr "" +msgstr "Basis nicht nutzbar mit reduziertem te" msgid "fx length wrong from t2 term: ignored" msgstr "falsche Länge für fx aus dem t2 Ausdruck: wird ignoriert" @@ -1187,19 +1176,19 @@ msgid "penalty order too high for basis dimension" msgstr "Straftermordnung zu groß für die Basisdimension" -#, fuzzy msgid "there is *no* information about some basis coefficients" -msgstr "" -"Knotenbereich ist so weit, dass er *keine* Information über einige " -"Basiskoeffizienten enthält. " +msgstr "es gibt *keine* Information über einige Basiskoeffizienten enthält" msgid "basis dimension is larger than number of unique covariates" msgstr "" "Basisdimension ist größer als die Zahl der unterschiedlichen Kovariaten" -msgid "requested non-existent derivative in B-spline penalty" +msgid "multiple penalties of the same order is silly" msgstr "" +msgid "requested non-existent derivative in B-spline penalty" +msgstr "nicht exisitierened Ableitung im B-Spline Strafterm angefordert" + msgid "fs smooths can only have one factor argument" msgstr "fs-Glätter können nur ein Faktorargument haben" @@ -1208,9 +1197,8 @@ "\"fs\" Glätter kann keine mehrfach bestrafte Basis nutzen (falsche Basis\n" "in xt)" -#, fuzzy msgid "no factor supplied to fs smooth" -msgstr "Keine Daten für gam.setup bereitgestellt" +msgstr "Kein Faktor angegeben für fs Glättung" msgid "\"fs\" terms can not be fixed here" msgstr "\"fs\" Ausdrücke können nicht hier festgelegt werden" @@ -1218,6 +1206,8 @@ msgid "" "fs smooth not suitable for discretisation with more than one metric predictor" msgstr "" +"fs Glättung passt nicht bei Diskretisierung mit mehr als einem metrischen " +"Prädiktor" msgid "the adaptive smooth class is limited to 1 or 2 covariates." msgstr "Die adaptive Glätterklasse ist beschränkt auf 1 oder 2 Kovariaten." @@ -1235,14 +1225,14 @@ "Please put term with most levels last in 're' to avoid spoiling supplied " "penalties" msgstr "" +"Bitte den Term mit den meisten Stufen auf die letzte Stellung in 're' " +"setzen, um die angegebenen Strafterme nicht zu beschädigen" -#, fuzzy msgid "supplied S matrices are wrong diminsion" -msgstr "Angegebener Strafterm hat falsche Dimension!" +msgstr "Angegebene S Matrix hat falsche Dimension!" -#, fuzzy msgid "argument of mrf should be a factor variable" -msgstr "Argument k von s() sollte ganzzahlig sein und wurde gerundet" +msgstr "Argument von mrf sollte eine Faktorvariable sein" msgid "MRF basis dimension set too high" msgstr "MRF Basisdimension ist zu hoch gesetzt" @@ -1308,11 +1298,10 @@ msgstr "Basisdimension auf mögliches Minimum zurückgesetzt" msgid "incorrect arguments to GP smoother" -msgstr "" +msgstr "Falsche Argumente für den GP Glätter" -#, fuzzy msgid "more knots than data in an ms term: knots ignored." -msgstr "mehr Knoten als Daten in einem sos Term: Knoten ignoriert." +msgstr "mehr Knoten als Daten in einem ms Term: Knoten ignoriert." msgid "smooth objects should not have a qrc attribute." msgstr "Glättungsobjekte sollten kein qrc-Attribut haben" @@ -1334,6 +1323,8 @@ "sweep and drop constraints unlikely to work well with self handling of by " "vars" msgstr "" +"\"sweep and drop\" Randbedingungen arbeiten wahrscheinlich nicht gut mit dem " +"\"self handling\" durch vars" msgid "factor `by' variables can not be used with matrix arguments." msgstr "" @@ -1407,6 +1398,42 @@ msgid "object not fully initialized" msgstr "Objekt nicht voll initialisiert" +#~ msgid "discretization can not handle smooth ids" +#~ msgstr "Diskretisierung kann glatte ids nicht behandeln" + +#~ msgid "cox.ph does not yet handle offsets" +#~ msgstr "cox.ph kann mit offsets nicht umgehen" + +#~ msgid "scaled t df must be > min.df" +#~ msgstr "skalierte t df müssen > min.df sein" + +#~ msgid "Extended Fellner Schall only implemented for general families" +#~ msgstr "" +#~ "Erweiterter Fellner Schall nur für allgemeine Familien implementiert" + +#~ msgid "p-values may give low power in some circumstances" +#~ msgstr "p-Werte können unter Umständen geringere Power geben" + +#~ msgid "p-values un-reliable" +#~ msgstr "p-Werte unzuverlässig" + +#~ msgid "p-values may give very low power" +#~ msgstr "p-Werte geben evtl. sehr geringe Power" + +#~ msgid "p.type!=0 is deprecated, and liable to be removed in future" +#~ msgstr "p.type!=0 ist veraltet und wird in der Zukunft entfernt" + +#~ msgid "no automatic plotting for smooths of more than one variable" +#~ msgstr "" +#~ "keine automatische Darstellung für Glättungen von mehr als einer Variable" + +#~ msgid "" +#~ "single penalty tensor product smooths are deprecated and likely to be " +#~ "removed soon" +#~ msgstr "" +#~ "Tensorprodukt-Glätter mit einfachem Strafterm sind veraltet und werden " +#~ "wahrscheinlich bald entfernt" + #~ msgid "non-finite coefficients at iteration" #~ msgstr "nicht-endliche Koeffizienten bei Iteration" diff -Nru mgcv-1.8-23/po/R-fr.po mgcv-1.8-24/po/R-fr.po --- mgcv-1.8-23/po/R-fr.po 2017-07-24 13:17:00.000000000 +0000 +++ mgcv-1.8-24/po/R-fr.po 2018-06-06 14:52:00.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mgcv 1.3-10\n" "Report-Msgid-Bugs-To: bugs@r-project.org\n" -"POT-Creation-Date: 2017-07-24 10:46\n" +"POT-Creation-Date: 2018-06-06 15:48\n" "PO-Revision-Date: 2005-12-09 09:13+0100\n" "Last-Translator: Philippe Grosjean \n" "Language-Team: French \n" @@ -20,10 +20,10 @@ msgid "bam can not discretize with this nesting structure" msgstr "" -msgid "discretization can not handle smooth ids" +msgid "'family' argument seems not to be a valid family object" msgstr "" -msgid "'family' argument seems not to be a valid family object" +msgid "This family should not have a matrix response" msgstr "" #, fuzzy @@ -64,8 +64,9 @@ msgid "family not recognized" msgstr "famille non reconnue" -msgid "extended families not supported by bam" -msgstr "" +#, fuzzy +msgid "general families not supported by bam" +msgstr "argument test ignor" msgid "un-supported smoothness selection method" msgstr "" @@ -82,6 +83,9 @@ msgid "min.sp not supported with fast REML computation, and ignored." msgstr "" +msgid "no smooths, ignoring `discrete=TRUE'" +msgstr "" + msgid "Not enough (non-NA) data to do anything meaningful" msgstr "Pas assez de donnes (non-NA) pour faire quoi que ce soit d'utile" @@ -109,10 +113,17 @@ msgid "link not available for coxph family; available link is \"identity\"" msgstr "" +#, fuzzy +msgid "something wrong with stratified prediction" +msgstr "il y a quelque chose d'anormal avec l'argument d." + msgid "NA times supplied for cox.ph prediction" msgstr "" -msgid "cox.ph does not yet handle offsets" +msgid "not an extended family" +msgstr "" + +msgid "step failure in theta estimation" msgstr "" msgid "" @@ -156,9 +167,8 @@ "\", \"log\", and \"inverse\"" msgstr "" -#, fuzzy -msgid "scaled t df must be > min.df" -msgstr "la valeur de epsilon doit tre > 0" +msgid "Supplied df below min.df. min.df reset" +msgstr "" msgid "NA values not allowed for the scaled t family" msgstr "" @@ -360,6 +370,9 @@ msgid "Non-finite coefficients at iteration" msgstr "Coefficients non finis l'itration" +msgid "non finite values in Hessian" +msgstr "" + msgid "indefinite penalized likelihood in gam.fit5" msgstr "" @@ -709,9 +722,6 @@ msgid "unknown outer optimization method." msgstr "Mthode d'optimisation externe GAM inconnue." -msgid "Extended Fellner Schall only implemented for general families" -msgstr "" - msgid "Please provide a single value for theta or use nb to estimate it" msgstr "" @@ -804,6 +814,9 @@ "newdata est un model.frame : il devrait contenir toutes les variables " "requises" +msgid "no NAs allowed in response data for this model" +msgstr "" + msgid "not all required variables have been supplied in newdata!" msgstr "les variables requises n'ont pas toutes t fournies dans newdata!" @@ -837,23 +850,11 @@ msgid "m can't be in re" msgstr "" -msgid "p-values may give low power in some circumstances" -msgstr "" - -msgid "p-values un-reliable" -msgstr "" - -msgid "p-values may give very low power" -msgstr "" - msgid "" "p-values for any terms that can be penalized to zero will be unreliable: " "refit model to fix this." msgstr "" -msgid "p.type!=0 is deprecated, and liable to be removed in future" -msgstr "" - msgid "The following arguments to anova.glm(..) are invalid and dropped:" msgstr "Les arguments suivants de anova.glm(..) sont incorrects et ignors :" @@ -953,8 +954,12 @@ msgid "no automatic plotting for smooths of more than two variables" msgstr "aucun graphe automatique pour les lissages de plus de deux variables" -msgid "no automatic plotting for smooths of more than one variable" -msgstr "aucun graphe automatique pour les lissages de plus d'une variable" +#, fuzzy +msgid "no automatic plotting for smooths of more than four variables" +msgstr "aucun graphe automatique pour les lissages de plus de deux variables" + +msgid "argument pers is deprecated, please use scheme instead" +msgstr "" msgid "residuals argument to plot.gam is wrong length: ignored" msgstr "" @@ -1087,11 +1092,6 @@ msgid "reparameterization unstable for margin: not done" msgstr "" -msgid "" -"single penalty tensor product smooths are deprecated and likely to be " -"removed soon" -msgstr "" - msgid "basis not usable with reduced te" msgstr "" @@ -1168,6 +1168,9 @@ msgid "basis dimension is larger than number of unique covariates" msgstr "" +msgid "multiple penalties of the same order is silly" +msgstr "" + msgid "requested non-existent derivative in B-spline penalty" msgstr "" @@ -1376,6 +1379,13 @@ msgstr "" #, fuzzy +#~ msgid "scaled t df must be > min.df" +#~ msgstr "la valeur de epsilon doit tre > 0" + +#~ msgid "no automatic plotting for smooths of more than one variable" +#~ msgstr "aucun graphe automatique pour les lissages de plus d'une variable" + +#, fuzzy #~ msgid "non-finite coefficients at iteration" #~ msgstr "Coefficients non finis l'itration" diff -Nru mgcv-1.8-23/po/R-ko.po mgcv-1.8-24/po/R-ko.po --- mgcv-1.8-23/po/R-ko.po 2017-07-24 13:17:00.000000000 +0000 +++ mgcv-1.8-24/po/R-ko.po 2018-06-06 14:52:00.000000000 +0000 @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: R 3.1.3\n" "Report-Msgid-Bugs-To: bugs.r-project.org\n" -"POT-Creation-Date: 2017-07-24 10:46\n" +"POT-Creation-Date: 2018-06-06 15:48\n" "PO-Revision-Date: 2015-02-21 16:01-0600\n" "Last-Translator:Chel Hee Lee \n" "Language-Team: Chel Hee Lee \n" @@ -27,12 +27,12 @@ msgid "bam can not discretize with this nesting structure" msgstr "" -msgid "discretization can not handle smooth ids" -msgstr "" - msgid "'family' argument seems not to be a valid family object" msgstr "'family' 인자는 올바른 family 객체가 아닌 것 같이 보입니다." +msgid "This family should not have a matrix response" +msgstr "" + msgid "cannot find valid starting values: please specify some" msgstr "사용가능한 초기값을 찾을 수 없습니다. 값을 지정해 주시길 바랍니다." @@ -68,8 +68,10 @@ msgid "family not recognized" msgstr "family에 대한 정보를 찾을 수 없습니다." -msgid "extended families not supported by bam" +#, fuzzy +msgid "general families not supported by bam" msgstr "" +"plot.gam에 전달되는 인자 residuals의 길이가 올바르지 않아 무시되었습니다. " msgid "un-supported smoothness selection method" msgstr "지원되지 않는 평활화 선택법(smoothness selection method)입니다." @@ -87,6 +89,9 @@ msgstr "" "fREML(fast REML 연산)을 method로 선택한 경우 min.sp는 사용되지 않습니다." +msgid "no smooths, ignoring `discrete=TRUE'" +msgstr "" + msgid "Not enough (non-NA) data to do anything meaningful" msgstr "" "어떤 의미있는 작업을 하기에는 NA가 아닌 데이터의 개수가 충분하지 않습니다." @@ -117,10 +122,18 @@ "coxph 페밀리(family)에 사용할 수 있는 링크(link)가 아닙니다. 사용가능한 링크" "(link)는 \"identity\"입니다." +#, fuzzy +msgid "something wrong with stratified prediction" +msgstr "zlim이 올바르지 않습니다." + msgid "NA times supplied for cox.ph prediction" msgstr "" -msgid "cox.ph does not yet handle offsets" +#, fuzzy +msgid "not an extended family" +msgstr "본 페밀리(family)에 사용가능한 링크(link)가 없습니다." + +msgid "step failure in theta estimation" msgstr "" msgid "" @@ -177,9 +190,8 @@ "다. 사용가능한 링크(link)에는 \"identity\", \"log\", 그리고 \"inverse\"가 있" "습니다." -#, fuzzy -msgid "scaled t df must be > min.df" -msgstr "스케일드 t 분포(scaled t)의 자유도(df)는 2보다 커야합니다." +msgid "Supplied df below min.df. min.df reset" +msgstr "" msgid "NA values not allowed for the scaled t family" msgstr "스케일드 t 페밀리(scaled t family)에는 NA 값을 사용할 수 없습니다." @@ -388,6 +400,9 @@ msgstr "" "다음의 반복에서 얻어진 계수의 추정치가 유한(finite)한 값을 가지지 않습니다." +msgid "non finite values in Hessian" +msgstr "" + msgid "indefinite penalized likelihood in gam.fit5" msgstr "" @@ -731,10 +746,6 @@ msgid "unknown outer optimization method." msgstr "알 수 없는 최적화 방법(optimization method)입니다." -#, fuzzy -msgid "Extended Fellner Schall only implemented for general families" -msgstr "본 페밀리(family)에 사용가능한 링크(link)가 없습니다." - msgid "Please provide a single value for theta or use nb to estimate it" msgstr "" @@ -820,6 +831,9 @@ msgstr "" "newdata는 model.frame이므로 필요한 모든 변수들을 포함하고 있어야 합니다." +msgid "no NAs allowed in response data for this model" +msgstr "" + msgid "not all required variables have been supplied in newdata!" msgstr "필요한 모든 변수들을 newdata로부터 찾을 수 없습니다!" @@ -854,23 +868,11 @@ msgid "m can't be in re" msgstr "m은 re 내에 있을 수 없습니다." -msgid "p-values may give low power in some circumstances" -msgstr "" - -msgid "p-values un-reliable" -msgstr "" - -msgid "p-values may give very low power" -msgstr "" - msgid "" "p-values for any terms that can be penalized to zero will be unreliable: " "refit model to fix this." msgstr "" -msgid "p.type!=0 is deprecated, and liable to be removed in future" -msgstr "" - msgid "The following arguments to anova.glm(..) are invalid and dropped:" msgstr "다음의 인자들은 anova.glm(..)에 유효하지 않으므로 사용되지 않습니다: " @@ -967,7 +969,10 @@ msgid "no automatic plotting for smooths of more than two variables" msgstr "" -msgid "no automatic plotting for smooths of more than one variable" +msgid "no automatic plotting for smooths of more than four variables" +msgstr "" + +msgid "argument pers is deprecated, please use scheme instead" msgstr "" msgid "residuals argument to plot.gam is wrong length: ignored" @@ -1094,11 +1099,6 @@ msgid "reparameterization unstable for margin: not done" msgstr "" -msgid "" -"single penalty tensor product smooths are deprecated and likely to be " -"removed soon" -msgstr "" - msgid "basis not usable with reduced te" msgstr "" @@ -1170,6 +1170,9 @@ msgid "basis dimension is larger than number of unique covariates" msgstr "" +msgid "multiple penalties of the same order is silly" +msgstr "" + msgid "requested non-existent derivative in B-spline penalty" msgstr "" @@ -1368,6 +1371,14 @@ msgid "object not fully initialized" msgstr "완전히 초기화된 object가 아닙니다." +#, fuzzy +#~ msgid "scaled t df must be > min.df" +#~ msgstr "스케일드 t 분포(scaled t)의 자유도(df)는 2보다 커야합니다." + +#, fuzzy +#~ msgid "Extended Fellner Schall only implemented for general families" +#~ msgstr "본 페밀리(family)에 사용가능한 링크(link)가 없습니다." + #~ msgid "non-finite coefficients at iteration" #~ msgstr "" #~ "다음의 반복단계에서 얻어진 계수(coefficients)의 값이 유한(finite)하지 않습" diff -Nru mgcv-1.8-23/po/R-mgcv.pot mgcv-1.8-24/po/R-mgcv.pot --- mgcv-1.8-23/po/R-mgcv.pot 2017-07-24 13:17:00.000000000 +0000 +++ mgcv-1.8-24/po/R-mgcv.pot 2018-06-06 14:52:00.000000000 +0000 @@ -1,7 +1,7 @@ msgid "" msgstr "" -"Project-Id-Version: mgcv 1.8-18\n" -"POT-Creation-Date: 2017-07-24 10:46\n" +"Project-Id-Version: mgcv 1.8-24\n" +"POT-Creation-Date: 2018-06-06 15:48\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -13,10 +13,10 @@ msgid "bam can not discretize with this nesting structure" msgstr "" -msgid "discretization can not handle smooth ids" +msgid "'family' argument seems not to be a valid family object" msgstr "" -msgid "'family' argument seems not to be a valid family object" +msgid "This family should not have a matrix response" msgstr "" msgid "cannot find valid starting values: please specify some" @@ -52,7 +52,7 @@ msgid "family not recognized" msgstr "" -msgid "extended families not supported by bam" +msgid "general families not supported by bam" msgstr "" msgid "un-supported smoothness selection method" @@ -70,6 +70,9 @@ msgid "min.sp not supported with fast REML computation, and ignored." msgstr "" +msgid "no smooths, ignoring `discrete=TRUE'" +msgstr "" + msgid "Not enough (non-NA) data to do anything meaningful" msgstr "" @@ -97,10 +100,16 @@ msgid "link not available for coxph family; available link is \"identity\"" msgstr "" +msgid "something wrong with stratified prediction" +msgstr "" + msgid "NA times supplied for cox.ph prediction" msgstr "" -msgid "cox.ph does not yet handle offsets" +msgid "not an extended family" +msgstr "" + +msgid "step failure in theta estimation" msgstr "" msgid "link not available for ordered categorical family; available links are \"identity\"" @@ -136,7 +145,7 @@ msgid "link not available for scaled t distribution; available links are \"identity\", \"log\", and \"inverse\"" msgstr "" -msgid "scaled t df must be > min.df" +msgid "Supplied df below min.df. min.df reset" msgstr "" msgid "NA values not allowed for the scaled t family" @@ -322,6 +331,9 @@ msgid "Non-finite coefficients at iteration" msgstr "" +msgid "non finite values in Hessian" +msgstr "" + msgid "indefinite penalized likelihood in gam.fit5" msgstr "" @@ -634,9 +646,6 @@ msgid "unknown outer optimization method." msgstr "" -msgid "Extended Fellner Schall only implemented for general families" -msgstr "" - msgid "Please provide a single value for theta or use nb to estimate it" msgstr "" @@ -715,6 +724,9 @@ msgid "newdata is a model.frame: it should contain all required variables" msgstr "" +msgid "no NAs allowed in response data for this model" +msgstr "" + msgid "not all required variables have been supplied in newdata!" msgstr "" @@ -745,21 +757,9 @@ msgid "m can't be in re" msgstr "" -msgid "p-values may give low power in some circumstances" -msgstr "" - -msgid "p-values un-reliable" -msgstr "" - -msgid "p-values may give very low power" -msgstr "" - msgid "p-values for any terms that can be penalized to zero will be unreliable: refit model to fix this." msgstr "" -msgid "p.type!=0 is deprecated, and liable to be removed in future" -msgstr "" - msgid "The following arguments to anova.glm(..) are invalid and dropped:" msgstr "" @@ -850,7 +850,10 @@ msgid "no automatic plotting for smooths of more than two variables" msgstr "" -msgid "no automatic plotting for smooths of more than one variable" +msgid "no automatic plotting for smooths of more than four variables" +msgstr "" + +msgid "argument pers is deprecated, please use scheme instead" msgstr "" msgid "residuals argument to plot.gam is wrong length: ignored" @@ -970,9 +973,6 @@ msgid "reparameterization unstable for margin: not done" msgstr "" -msgid "single penalty tensor product smooths are deprecated and likely to be removed soon" -msgstr "" - msgid "basis not usable with reduced te" msgstr "" @@ -1042,6 +1042,9 @@ msgid "basis dimension is larger than number of unique covariates" msgstr "" +msgid "multiple penalties of the same order is silly" +msgstr "" + msgid "requested non-existent derivative in B-spline penalty" msgstr "" diff -Nru mgcv-1.8-23/po/R-pl.po mgcv-1.8-24/po/R-pl.po --- mgcv-1.8-23/po/R-pl.po 2017-07-24 13:17:00.000000000 +0000 +++ mgcv-1.8-24/po/R-pl.po 2018-06-06 14:52:00.000000000 +0000 @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: mgcv 1.7-28\n" "Report-Msgid-Bugs-To: bugs@r-project.org\n" -"POT-Creation-Date: 2017-07-24 10:46\n" +"POT-Creation-Date: 2018-06-06 15:48\n" "PO-Revision-Date: 2014-03-25 17:39+0100\n" "Last-Translator: Łukasz Daniel \n" "Language-Team: Łukasz Daniel \n" @@ -18,9 +18,6 @@ msgid "bam can not discretize with this nesting structure" msgstr "" -msgid "discretization can not handle smooth ids" -msgstr "" - # mgcv/R/bam.r: 161 # stop("'family' argument seems not to be a valid family object") # mgcv/R/bam.r: 480 @@ -29,6 +26,9 @@ msgstr "" "argument 'family' wydaje się nie być poprawnym obiektem klasy \"family\"" +msgid "This family should not have a matrix response" +msgstr "" + # mgcv/R/bam.r: 184 # stop("cannot find valid starting values: please specify some") # mgcv/R/bam.r: 503 @@ -114,8 +114,11 @@ msgid "family not recognized" msgstr "'family' nie został rozpoznany" -msgid "extended families not supported by bam" -msgstr "" +# mgcv/R/mgcv.r: 3063 +# warning("'test' argument ignored") +#, fuzzy +msgid "general families not supported by bam" +msgstr "argument 'test' został zignorowany" # mgcv/R/bam.r: 1079 # stop("unsupported smoothness selection method") @@ -138,6 +141,9 @@ "'min.sp' nie jest wspierane dla szybkich obliczeń REML, parametr został " "zignorowany." +msgid "no smooths, ignoring `discrete=TRUE'" +msgstr "" + # mgcv/R/gamm.r: 1414 # stop("Not enough (non-NA) data to do anything meaningful") # mgcv/R/bam.r: 1106 @@ -193,10 +199,21 @@ ": połączenie nie jest dostępne dla rodziny rozkładu Pascala; dostępne " "połączenia to \"identity\", \"log\" oraz \"sqrt\"" +# mgcv/R/smooth.r: 265 +# warning("something wrong with argument 'd'.") +# mgcv/R/smooth.r: 373 +# warning("something wrong with argument 'd'.") +#, fuzzy +msgid "something wrong with stratified prediction" +msgstr "coś nie tak z argumentem 'd'" + msgid "NA times supplied for cox.ph prediction" msgstr "" -msgid "cox.ph does not yet handle offsets" +msgid "not an extended family" +msgstr "" + +msgid "step failure in theta estimation" msgstr "" # mgcv/R/gam.fit3.r: 2093 @@ -272,11 +289,8 @@ ": połączenie nie jest dostępne dla rodziny rozkładu Pascala; dostępne " "połączenia to \"identity\", \"log\" oraz \"sqrt\"" -# mgcv/R/mgcv.r: 1678 -# stop("value of epsilon must be > 0") -#, fuzzy -msgid "scaled t df must be > min.df" -msgstr "wartość 'epsilon' musi być > 0" +msgid "Supplied df below min.df. min.df reset" +msgstr "" # mgcv/R/gam.fit3.r: 2126 # stop("negative values not allowed for the negative binomial family") @@ -665,6 +679,9 @@ msgid "Non-finite coefficients at iteration" msgstr "Nieskończone współczynniki w iteracji" +msgid "non finite values in Hessian" +msgstr "" + msgid "indefinite penalized likelihood in gam.fit5" msgstr "" @@ -1207,9 +1224,6 @@ msgid "unknown outer optimization method." msgstr "nieznana zewnętrzna metoda optymalizacji" -msgid "Extended Fellner Schall only implemented for general families" -msgstr "" - msgid "Please provide a single value for theta or use nb to estimate it" msgstr "" @@ -1350,6 +1364,12 @@ "\"newdata\" jest klasy \"model.frame\": powinien zawierać wszystkie wymagane " "zmienne" +# mgcv/R/mgcv.r: 2352 +# stop("nothing to do for this model") +#, fuzzy +msgid "no NAs allowed in response data for this model" +msgstr "nic do zrobienia dla tego modelu" + # mgcv/R/mgcv.r: 2139 # warning("not all required variables have been supplied in newdata!\n") msgid "not all required variables have been supplied in newdata!" @@ -1395,21 +1415,6 @@ msgid "m can't be in re" msgstr "argument 'm' nie może być w argumencie 're'" -# mgcv/R/mgcv.r: 2716 -# warning("p-values may give low power in some circumstances") -msgid "p-values may give low power in some circumstances" -msgstr "p-wartość może dać niską moc w pewnych okolicznościach" - -# mgcv/R/mgcv.r: 2719 -# warning("p-values un-reliable") -msgid "p-values un-reliable" -msgstr "p-wartość nie jest wiarygodna" - -# mgcv/R/mgcv.r: 2723 -# warning("p-values may give very low power") -msgid "p-values may give very low power" -msgstr "p-wartości mogą dać bardzo niską moc" - # mgcv/R/mgcv.r: 2822 # warning("p-values for any terms that can be penalized to zero will be unreliable: refit model to fix this.") msgid "" @@ -1419,9 +1424,6 @@ "p-wartości dla jakichkolwiek członów, które da się ukarać do zera, będą " "nierzetelne: ponownie dopasuj model aby to naprawić" -msgid "p.type!=0 is deprecated, and liable to be removed in future" -msgstr "" - # mgcv/R/mgcv.r: 3053 # warning(gettext("The following arguments to anova.glm(..) are invalid and dropped: ", domain = "R-mgcv"), paste(deparse(dotargs[named]), collapse = ", "), domain = NA) msgid "The following arguments to anova.glm(..) are invalid and dropped:" @@ -1556,11 +1558,15 @@ msgstr "" "brak automatycznego rysowania dla wygładzeń o więcej niż dwóch zmiennych" -# mgcv/R/plots.r: 959 -# warning("no automatic plotting for smooths of more than one variable") -msgid "no automatic plotting for smooths of more than one variable" +# mgcv/R/plots.r: 916 +# warning("no automatic plotting for smooths of more than two variables") +#, fuzzy +msgid "no automatic plotting for smooths of more than four variables" +msgstr "" +"brak automatycznego rysowania dla wygładzeń o więcej niż dwóch zmiennych" + +msgid "argument pers is deprecated, please use scheme instead" msgstr "" -"brak automatycznego rysowania dla wygładzeń o więcej niż jednej zmiennej" # mgcv/R/plots.r: 1012 # warning("residuals argument to plot.gam is wrong length: ignored") @@ -1808,11 +1814,6 @@ msgid "reparameterization unstable for margin: not done" msgstr "ponowna parametryzacja nie jest stabilna dla marginesu: nie wykonano" -msgid "" -"single penalty tensor product smooths are deprecated and likely to be " -"removed soon" -msgstr "" - msgid "basis not usable with reduced te" msgstr "" @@ -1969,6 +1970,9 @@ msgid "basis dimension is larger than number of unique covariates" msgstr "" +msgid "multiple penalties of the same order is silly" +msgstr "" + msgid "requested non-existent derivative in B-spline penalty" msgstr "" @@ -2344,6 +2348,33 @@ msgid "object not fully initialized" msgstr "obiekt nie został w pełni zainicjalizowany" +# mgcv/R/mgcv.r: 1678 +# stop("value of epsilon must be > 0") +#, fuzzy +#~ msgid "scaled t df must be > min.df" +#~ msgstr "wartość 'epsilon' musi być > 0" + +# mgcv/R/mgcv.r: 2716 +# warning("p-values may give low power in some circumstances") +#~ msgid "p-values may give low power in some circumstances" +#~ msgstr "p-wartość może dać niską moc w pewnych okolicznościach" + +# mgcv/R/mgcv.r: 2719 +# warning("p-values un-reliable") +#~ msgid "p-values un-reliable" +#~ msgstr "p-wartość nie jest wiarygodna" + +# mgcv/R/mgcv.r: 2723 +# warning("p-values may give very low power") +#~ msgid "p-values may give very low power" +#~ msgstr "p-wartości mogą dać bardzo niską moc" + +# mgcv/R/plots.r: 959 +# warning("no automatic plotting for smooths of more than one variable") +#~ msgid "no automatic plotting for smooths of more than one variable" +#~ msgstr "" +#~ "brak automatycznego rysowania dla wygładzeń o więcej niż jednej zmiennej" + # mgcv/R/bam.r: 425 # warning(gettextf("non-finite coefficients at iteration %d", iter)) # mgcv/R/bam.r: 600 diff -Nru mgcv-1.8-23/R/bam.r mgcv-1.8-24/R/bam.r --- mgcv-1.8-23/R/bam.r 2018-01-07 08:37:03.000000000 +0000 +++ mgcv-1.8-24/R/bam.r 2018-05-11 12:09:45.000000000 +0000 @@ -211,7 +211,7 @@ ## * nr records the number of unique discretized covariate values ## i.e. the number of rows before the padding starts ## * k.start contains the starting column in index vector k, for -## each variable. +## each variable. The final element is the column beyond the last one. ## * k is the index matrix. The ith record of the 1st column of the ## jth variable is in row k[i,k.start[j]] of the corresponding ## column of mf. @@ -527,7 +527,7 @@ for (iter in 1L:control$maxit) { ## main fitting loop devold <- dev dev <- 0 - ## accumulate the QR decomposition of the weighted model matrix + if (iter==1||!additive) { qrx <- list() @@ -536,10 +536,13 @@ eta <- Xbd(G$Xd,coef,G$kd,G$ks,G$ts,G$dt,G$v,G$qc,G$drop) + offset lsp.full <- G$lsp0 if (n.sp>0) lsp.full <- lsp.full + if (is.null(G$L)) lsp[1:n.sp] else G$L %*% lsp[1:n.sp] - Sb <- Sl.Sb(Sl,lsp.full,prop$beta) ## store S beta to allow rapid step halving + #Sb <- Sl.Sb(Sl,lsp.full,prop$beta) ## store S beta to allow rapid step halving + rSb <- Sl.rSb(Sl,lsp.full,prop$beta) ## store S beta to allow rapid step halving if (iter>2) { - Sb0 <- Sl.Sb(Sl,lsp.full,b0) - bSb0 <- sum(b0*Sb0) ## penalty at start of beta step + #Sb0 <- Sl.Sb(Sl,lsp.full,b0) + #bSb0 <- sum(b0*Sb0) ## penalty at start of beta step + rSb0 <- Sl.rSb(Sl,lsp.full,b0) + bSb0 <- sum(rSb0^2) ## get deviance at step start, with current theta if efam dev0 <- if (efam) sum(family$dev.resids(G$y,mu0,G$w,theta)) else sum(family$dev.resids(G$y,mu0,G$w)) @@ -551,10 +554,12 @@ dev <- if (efam) sum(family$dev.resids(G$y,mu,G$w,theta)) else sum(family$dev.resids(G$y,mu,G$w)) if (iter>2) { ## coef step length control - bSb <- sum(prop$beta*Sb) ## penalty at end of beta step - if (dev0 + bSb0 < dev + bSb && kk < 30) { ## beta step not improving current pen dev + #bSb <- sum(prop$beta*Sb) ## penalty at end of beta step + bSb <- sum(rSb^2) ## penalty at end of beta step + if ((!is.finite(dev) || dev0 + bSb0 < dev + bSb) && kk < 30) { ## beta step not improving current pen dev coef <- (coef0 + coef)/2 ## halve the step - Sb <- (Sb0 + Sb)/2 + #Sb <- (Sb0 + Sb)/2 + rSb <- (rSb0 + rSb)/2 eta <- (eta0 + eta)/2 prop$beta <- (b0 + prop$beta)/2 kk <- kk + 1 @@ -567,7 +572,8 @@ eta0 <- eta mu0 <- mu b0 <- prop$beta ## beta repara - dev <- dev + sum(prop$beta*Sb) ## add penalty to deviance + #dev <- dev + sum(prop$beta*Sb) ## add penalty to deviance + dev <- dev + sum(rSb^2) } else reml <- dev ## for convergence checking if (efam) { ## extended family @@ -2113,7 +2119,7 @@ } else { ## not a tensor smooth v[[kb]] <- rep(0,0) dt[kb] <- dt[kb] + 1 - G$Xd[[k]] <- G$X[1:dk$nr[k],G$smooth[[i]]$first.para:G$smooth[[i]]$last.para] + G$Xd[[k]] <- G$X[1:dk$nr[k],G$smooth[[i]]$first.para:G$smooth[[i]]$last.para,drop=FALSE] k <- k + 1 } kb <- kb + 1 diff -Nru mgcv-1.8-23/R/coxph.r mgcv-1.8-24/R/coxph.r --- mgcv-1.8-23/R/coxph.r 2017-11-01 15:11:23.000000000 +0000 +++ mgcv-1.8-24/R/coxph.r 2018-06-06 11:55:37.000000000 +0000 @@ -39,6 +39,7 @@ G$X <- G$X[y.order,,drop=FALSE] attributes(G$X) <- attrX G$w <- G$w[y.order] + G$offset <- G$offset[y.order] }) postproc <- expression({ @@ -46,7 +47,7 @@ ## baseline hazard estimation... ## first get the estimated hazard and prediction information... G$X <- Sl.initial.repara(G$Sl,G$X,inverse=TRUE,cov=FALSE,both.sides=FALSE) - object$family$data <- G$family$hazard(G$y,G$X,object$coefficients,G$w) + object$family$data <- G$family$hazard(G$y,G$X,object$coefficients,G$w,G$offset) rumblefish <- G$family$hazard(G$y,matrix(0,nrow(G$X),0),object$coefficients,G$w) s0.base <- exp(-rumblefish$h[rumblefish$r]) ## no model baseline survival s0.base[s0.base >= 1] <- 1 - 2*.Machine$double.eps ## avoid NA later @@ -69,7 +70,7 @@ if (is.null(start)) start <- rep(0,ncol(x)) }) - hazard <- function(y, X,beta,wt) { + hazard <- function(y, X,beta,wt,offset=0) { ## get the baseline hazard function information, given times in descending order in y ## model matrix (same ordering) in X, coefs in beta and censoring in wt (1 = death, 0 ## = censoring) @@ -96,7 +97,7 @@ } #tr <- unique(y);nt <- length(tr) p <- ncol(X) - eta <- as.double(X%*%beta) + eta <- as.double(X%*%beta) + offset if (ns==1) { r <- match(y,tr) oo <- .C("coxpp",eta,A=as.double(X),as.integer(r),d=as.integer(wt), @@ -156,9 +157,10 @@ } if (sum(is.na(y))>0) stop("NA times supplied for cox.ph prediction") X <- X[ii,,drop=FALSE];y <- y[ii]; + n <- nrow(X) + if (is.null(off)) off <- rep(0,n) if (is.null(strat)) { - n <- nrow(X) - oo <- .C("coxpred",as.double(X),t=as.double(y),as.double(beta),as.double(Vb), + oo <- .C("coxpred",as.double(X),t=as.double(y),as.double(beta),as.double(off),as.double(Vb), a=as.double(family$data$a),h=as.double(family$data$h),q=as.double(family$data$q), tr = as.double(family$data$tr), n=as.integer(n),p=as.integer(ncol(X)),nt = as.integer(family$data$nt), @@ -175,7 +177,7 @@ ind <- which(strat==pstrata[i]) ## prediction data index trind <- which(family$data$tr.strat == pstrata[i]) n <- length(ind) - oo <- .C("coxpred",as.double(X[ind,]),t=as.double(y[ind]),as.double(beta),as.double(Vb), + oo <- .C("coxpred",as.double(X[ind,]),t=as.double(y[ind]),as.double(beta),as.double(off),as.double(Vb), a=as.double(family$data$a[,trind]),h=as.double(family$data$h[trind]),q=as.double(family$data$q[trind]), tr = as.double(family$data$tr[trind]), n=as.integer(n),p=as.integer(p),nt = as.integer(length(trind)), @@ -205,7 +207,8 @@ ## or its Choleski factor ## D is the diagonal pre-conditioning matrix used to obtain Hp ## if Hr is the raw Hp then Hp = D*t(D*Hr) - if (!is.null(offset)&&sum(offset!=0)) stop("cox.ph does not yet handle offsets") + +#!! if (!is.null(offset)&&sum(offset!=0)) stop("cox.ph does not yet handle offsets") if (is.matrix(y)) { ## first column is time, second is *numeric* code indicating strata @@ -217,7 +220,7 @@ p <- ncol(X) deriv <- deriv - 1 - mu <- X%*%coef + mu <- X%*%coef + offset g <- rep(0,p);H <- rep(0,p*p) if (deriv > 0) { M <- ncol(d1b) diff -Nru mgcv-1.8-23/R/efam.r mgcv-1.8-24/R/efam.r --- mgcv-1.8-23/R/efam.r 2017-12-06 09:16:31.000000000 +0000 +++ mgcv-1.8-24/R/efam.r 2018-05-11 12:09:45.000000000 +0000 @@ -1,12 +1,13 @@ -## (c) Simon N. Wood (ocat, tw, nb, ziP) & Natalya Pya (scat, beta), +## (c) Simon N. Wood & Natalya Pya (scat, beta), ## 2013-2017. Released under GPL2. +## See gam.fit4.r for testing functions fmud.test and fetad.test. estimate.theta <- function(theta,family,y,mu,scale=1,wt=1,tol=1e-7,attachH=FALSE) { ## Simple Newton iteration to estimate theta for an extended family, ## given y and mu. To be iterated with estimation of mu given theta. ## If used within a PIRLS loop then divergence testing of coef update ## will have to re-compute pdev after theta update. -## Not clear best way to handle scale - could oprimize here as well +## Not clear best way to handle scale - could optimize here as well if (!inherits(family,"extended.family")) stop("not an extended family") @@ -115,15 +116,15 @@ ## function fix.family.link.extended.family with functions ## gkg where k is 2,3 or 4 giving the kth derivative of the ## link over the first derivative of the link to the power k. -## for non standard links these functions muct be supplied. +## for non standard links these functions must be supplied. ## dev.resids - function computing deviance residuals. ## Dd - function returning derivatives of deviance residuals w.r.t. mu and theta. -## aic - function computing twice - log likelihood for 2df to be added to. +## aic - function computing twice -ve log likelihood for 2df to be added to. ## initialize - expression to be evaluated in gam.fit4 and initial.spg ## to initialize mu or eta. ## preinitialize - optional function of y and family, returning a list with optional elements ## Theta - intitial Theta and y - modified y for use in fitting (see e.g. ocat and betar) -## postproc - function with arguments family,y,prior.weights,fitted,linear.predictors,offset,intercept +## postproc - function with arguments family, y, prior.weights, fitted, linear.predictors, offset, intercept ## to call after fit to compute (optionally) the label for the family, deviance and null deviance. ## See ocat for simple example and betar or ziP for complicated. Called in estimate.gam. ## ls - function to evaluated log saturated likelihood and derivatives w.r.t. @@ -140,7 +141,7 @@ ## predict - optional function for predicting from model, called by predict.gam. ## family$data - optional list storing any family specific data for use, e.g. in predict ## function. - deprecated (commented out below - appears to be used nowhere) - +## scale - < 0 to estimate. ignored if NULL ## extended family object for ordered categorical @@ -254,7 +255,7 @@ } ## end of dev.resids Dd <- function(y, mu, theta, wt=NULL, level=0) { - ## derivatives of the deviance... + ## derivatives of the ocat deviance... # F <- function(x) { ## e^(x)/(1+e^x) without overflow # h <- ind <- x > 0; h[ind] <- 1/(exp(-x[ind]) + 1) # x <- exp(x[!ind]); h[!ind] <- (x/(1+x)) @@ -387,7 +388,8 @@ oo$Dth[ind,k] <- Da0[ind]*etk oo$Dmuth[ind,k] <- Dmua0[ind]*etk oo$Dmu2th[ind,k] <- Dmu2a0[ind]*etk - } + } + oo$EDmu2th <- oo$Dmu2th } if (level >1) { ## and the second derivative components oo$Dmu4 <- 2*((3*b^2 + 4*a*c)/f + a2*(6*a2/f - 12*b)/f2 - d)/f @@ -440,7 +442,7 @@ } } oo - } ## end of Dd + } ## end of Dd (ocat) aic <- function(y, mu, theta=NULL, wt, dev) { @@ -473,77 +475,7 @@ ls <- function(y,w,theta,scale) { ## the log saturated likelihood function. - #! actually only first line used since re-def as 0 - #vec <- !is.null(attr(theta,"vec.grad")) - #lsth1 <- if (vec) matrix(0,length(y),R-2) else rep(0,R-2) return(list(ls=0,lsth1=rep(0,R-2),lsth2=matrix(0,R-2,R-2))) - F <- function(x) { - h <- ind <- x > 0; h[ind] <- 1/(exp(-x[ind]) + 1) - x <- exp(x[!ind]); h[!ind] <- (x/(1+x)) - h - } - Fdiff <- function(a,b) { - ## cancellation resistent F(b)-F(a), b>a - h <- rep(1,length(b)); h[b>0] <- -1; eb <- exp(b*h) - h <- h*0+1; h[a>0] <- -1; ea <- exp(a*h) - ind <- b<0;bi <- eb[ind];ai <- ea[ind] - h[ind] <- bi/(1+bi) - ai/(1+ai) - ind1 <- a>0;bi <- eb[ind1];ai <- ea[ind1] - h[ind1] <- (ai-bi)/((ai+1)*(bi+1)) - ind <- !ind & !ind1;bi <- eb[ind];ai <- ea[ind] - h[ind] <- (1-ai*bi)/((bi+1)*(ai+1)) - h - } - R = length(theta)+2 - alpha <- rep(0,R+1) ## the thresholds - alpha[1] <- -Inf;alpha[R+1] <- Inf - alpha[2] <- -1 - if (R > 2) { - ind <- 3:R - alpha[ind] <- alpha[2] + cumsum(exp(theta)) - } - al1 <- alpha[y+1];al0 = alpha[y] - g1 <- F((al1-al0)/2);g0 <- F((al0-al1)/2) - ##A <- pmax(g1 - g0,.Machine$double.eps) - A <- Fdiff((al0-al1)/2,(al1-al0)/2) - ls <- sum(log(A)) - B <- g1^2 - g1 + g0^2 - g0 - C <- 2 * g1^3 - 3 * g1^2 + g1 - 2 * g0^3 + 3 * g0^2 - g0 - Da0 <- .5 * B/A ; Da1 <- -0.5 *B/A - Da0a0 <- .25 * C/A - .25 * B^2/A^2 - Da1a1 <- .25 * C/A - .25 * B^2/A^2 - Da0a1 <- - .25 * C/A + .25 * B^2/A^2 - i <- 0 - n2d <- (R-2)*(R-1)/2 - n <- length(y) - Dth <- matrix(0,n,R-2) - Dth2 <- matrix(0,n,n2d) - for (j in 1:(R-2)) for (k in j:(R-2)) { - i <- i + 1 ## the second deriv col - ind <- y >= j ## rest are zero - ar1.k <- ar.k <- rep(exp(theta[k]),n) - ar.k[y==R | y <= k] <- 0; ar1.k[yk&yk+1] <- exp(theta[k]) - Dth[ind,k] <- Da1[ind]*ar.k[ind] + Da0[ind]*ar1.k[ind] - } - Dth2[,i] <- Da1a1*ar.k*ar.j + Da0a1*ar.k*ar1.j + Da1 * ar.kj + - Da0a0*ar1.k*ar1.j + Da0a1*ar1.k*ar.j + Da0 * ar1.kj - } - lsth2=colSums(Dth2) - if (R>2) { - ls2 <- matrix(0,R-2,R-2);ii <- 0 - for (i in 1:(R-2)) for (j in i:(R-2)) { - ii <- ii + 1 - ls2[i,j] <- ls2[j,i] <- lsth2[ii] - } - } - list(ls=ls,lsth1=colSums(Dth),lsth2=ls2) - } ## end of ls ## initialization is interesting -- needs to be with reference to initial cut-points @@ -748,7 +680,7 @@ } Dd <- function(y, mu, theta, wt, level=0) { - ## derivatives of the deviance... + ## derivatives of the nb deviance... ##ltheta <- theta theta <- exp(theta) yth <- y + theta @@ -765,6 +697,7 @@ r$Dmuth <- 2 * wt * theta * (1 - yth/muth)/muth r$Dmu3 <- 4 * wt * (yth/muth^3 - y/mu^3) r$Dmu2th <- 2 * wt * theta * (2*yth/muth - 1)/muth^2 + r$EDmu2th <- 2 * wt / muth^2 } if (level>1) { ## whole damn lot r$Dmu4 <- 2 * wt * (6*y/mu^4 - 6*yth/muth^4) @@ -918,7 +851,7 @@ } Dd <- function(y, mu, theta, wt, level=0) { - ## derivatives of the deviance... + ## derivatives of the tw deviance... a <- get(".a");b <- get(".b") th <- theta p <- if (th>0) (b+a*exp(-th))/(1+exp(-th)) else (b*exp(th)+a)/(exp(th)+1) @@ -1116,7 +1049,7 @@ r$Dth <- 2 * wt *theta*(-mu*log.yoney - log1p(-y)+ mu*psi0.muth+onemu*psi0.onemuth -psi0.th) r$Dmuth <- r$Dmu + 2 * wt * theta^2*(mu*psi1.muth -onemu*psi1.onemuth) r$Dmu3 <- 2 * wt *theta^3 * (psi2.muth - psi2.onemuth) - r$Dmu2th <- 2* r$Dmu2 + 2 * wt * theta^3* (mu*psi2.muth + onemu*psi2.onemuth) + r$EDmu2th <- r$Dmu2th <- 2* r$Dmu2 + 2 * wt * theta^3* (mu*psi2.muth + onemu*psi2.onemuth) } if (level>1) { ## whole lot r$Dmu4 <- 2 * wt *theta^4 * (psi3.muth+psi3.onemuth) @@ -1387,7 +1320,7 @@ } Dd <- function(y, mu, theta, wt, level=0) { - ## derivatives of the deviance... + ## derivatives of the scat deviance... ## ltheta <- theta min.df <- get(".min.df") nu <- exp(theta[1])+min.df; sig <- exp(theta[2]) @@ -1847,6 +1780,7 @@ mu <- object$linear.predictors wts <- object$prior.weights res <- object$family$dev.resids(y,mu,wts) + ## next line is correct as function returns -2*saturated.log.lik res <- res - object$family$saturated.ll(y,object$family,wts) fv <- predict.gam(object,type="response") s <- attr(res,"sign") @@ -1854,7 +1788,7 @@ res <- as.numeric(sqrt(pmax(res,0)) * s) } res - } ## residuals + } ## residuals (ziP) predict <- function(family,se=FALSE,eta=NULL,y=NULL,X=NULL, beta=NULL,off=NULL,Vb=NULL) { diff -Nru mgcv-1.8-23/R/fast-REML.r mgcv-1.8-24/R/fast-REML.r --- mgcv-1.8-23/R/fast-REML.r 2018-01-06 10:23:10.000000000 +0000 +++ mgcv-1.8-24/R/fast-REML.r 2018-06-06 11:55:37.000000000 +0000 @@ -241,7 +241,7 @@ if (length(Sl[[b]]$S)==1) { ## singleton - multiple of identity a[ind] <- a[ind] + beta[ind] * exp(rho[k]) k <- k + 1 - } else { ## mulit-S block + } else { ## multi-S block for (j in 1:length(Sl[[b]]$S)) { a[ind] <- a[ind] + exp(rho[k]) * (Sl[[b]]$S[[j]] %*% beta[ind]) k <- k + 1 @@ -251,6 +251,37 @@ a } ## Sl.Sb +Sl.rSb <- function(Sl,rho,beta) { +## Computes vector 'a' containing all terms rS %*% beta stacked end to end. +## sum of squares of 'a' this is bSb, but 'a' is linear in beta +## Assumes initial re-parameterization has taken +## place, so single penalties are multiples of identity and uses S for +## multi-S blocks. Logic is identical to Sl.addS. + k <- 1 ## sp counter + kk <- 0 ## total length of returned vector + if (length(Sl)>0) for (b in 1:length(Sl)) { + ind <- (Sl[[b]]$start:Sl[[b]]$stop)[Sl[[b]]$ind] + kk <- kk + length(Sl[[b]]$S)*length(ind) + } + a <- rep(0,kk) + kk <- 0 + if (length(Sl)>0) for (b in 1:length(Sl)) { + ind <- (Sl[[b]]$start:Sl[[b]]$stop)[Sl[[b]]$ind] + if (length(Sl[[b]]$S)==1) { ## singleton - multiple of identity + a[kk + 1:length(ind)] <- beta[ind] * exp(rho[k]/2) + k <- k + 1 + kk <- kk + length(ind) + } else { ## multi-S block + for (j in 1:length(Sl[[b]]$S)) { + a[kk + 1:length(ind)] <- exp(rho[k]/2) * (beta[ind] %*% Sl[[b]]$rS[[j]]) + k <- k + 1 + kk <- kk + length(ind) + } + } + } + a +} ## Sl.rSb + Sl.initial.repara <- function(Sl,X,inverse=FALSE,both.sides=TRUE,cov=TRUE,nt=1) { ## Routine to apply initial Sl re-parameterization to model matrix X, ## or, if inverse==TRUE, to apply inverse re-para to parameter vector @@ -879,7 +910,7 @@ uconv.ind <- (abs(reml1) > tol)|(abs(diag(reml2))>tol) hess <- reml2 grad <- reml1 - if (length(grad)>0) { + if (length(grad)>0&&sum(uconv.ind)>0) { if (sum(uconv.ind)!=ncol(reml2)) { reml1 <- reml1[uconv.ind] reml2 <- reml2[uconv.ind,uconv.ind] diff -Nru mgcv-1.8-23/R/gam.fit3.r mgcv-1.8-24/R/gam.fit3.r --- mgcv-1.8-23/R/gam.fit3.r 2017-11-07 15:25:58.000000000 +0000 +++ mgcv-1.8-24/R/gam.fit3.r 2018-06-06 11:55:37.000000000 +0000 @@ -118,7 +118,7 @@ if (family$link==family$canonical) fisher <- TRUE else fisher=FALSE ## ... if canonical Newton = Fisher, but Fisher cheaper! if (scale>0) scale.known <- TRUE else scale.known <- FALSE - if (!scale.known&&scoreType%in%c("REML","ML")) { ## the final element of sp is actually log(scale) + if (!scale.known&&scoreType%in%c("REML","ML","EFS")) { ## the final element of sp is actually log(scale) nsp <- length(sp) scale <- exp(sp[nsp]) sp <- sp[-nsp] @@ -137,9 +137,10 @@ q <- ncol(x) + if (length(UrS)) { ## find a stable reparameterization... - - grderiv <- deriv*as.numeric(scoreType%in%c("REML","ML","P-REML","P-ML")) + + grderiv <- if (scoreType=="EFS") 1 else deriv*as.numeric(scoreType%in%c("REML","ML","P-REML","P-ML")) rp <- gam.reparam(UrS,sp,grderiv) ## note also detects fixed penalty if present ## Following is for debugging only... # deriv.check <- FALSE @@ -177,7 +178,8 @@ rows.E <- q-Mp Sr <- cbind(rp$E,matrix(0,nrow(rp$E),Mp)) St <- rbind(cbind(rp$S,matrix(0,nrow(rp$S),Mp)),matrix(0,Mp,q)) - } else { + } else { + grderiv <- 0 T <- diag(q); St <- matrix(0,q,q) rSncol <- sp <- rows.E <- Eb <- Sr <- 0 @@ -185,7 +187,12 @@ rp <- list(det=0,det1 = rep(0,0),det2 = rep(0,0),fixed.penalty=FALSE) } iter <- 0;coef <- rep(0,ncol(x)) - + + if (scoreType=="EFS") { + scoreType <- "REML" ## basically optimizing REML + deriv <- 0 ## only derivatives of log|S|_+ required (see above) + } + conv <- FALSE n <- nobs <- NROW(y) ## n is just to keep codetools happy if (n.true <= 0) n.true <- nobs ## n.true is used in criteria in place of nobs @@ -773,7 +780,7 @@ boundary = boundary,D1=D1,D2=D2,P=P,P1=P1,P2=P2,trA=trA,trA1=trA1,trA2=trA2, GCV=GCV,GCV1=GCV1,GCV2=GCV2,GACV=GACV,GACV1=GACV1,GACV2=GACV2,UBRE=UBRE, UBRE1=UBRE1,UBRE2=UBRE2,REML=REML,REML1=REML1,REML2=REML2,rV=rV,db.drho=db.drho, - dw.drho=dw.drho,dVkk = matrix(oo$dVkk,nSp,nSp), + dw.drho=dw.drho,dVkk = matrix(oo$dVkk,nSp,nSp),ldetS1 = if (grderiv) rp$det1 else 0, scale.est=scale.est,reml.scale= reml.scale,aic=aic.model,rank=oo$rank.est,K=Kmat) } ## end gam.fit3 @@ -1338,8 +1345,10 @@ ## tiny relative to largest, as this space is likely to be poorly ## modelled on scale of Newton step... - uconv.ind <- uconv.ind & abs(grad)>max(abs(grad))*.001 - + uconv.ind1 <- uconv.ind & abs(grad)>max(abs(grad))*.001 + if (sum(uconv.ind1)==0) uconv.ind1 <- uconv.ind ## nothing left reset + if (sum(uconv.ind)==0) uconv.ind[which(abs(grad)==max(abs(grad)))] <- TRUE ## need at least 1 to update + ## exclude apparently converged gradients from computation hess1 <- hess[uconv.ind,uconv.ind] grad1 <- grad[uconv.ind] @@ -1776,8 +1785,22 @@ score <- b$UBRE;grad <- t(L)%*%b$UBRE1 } else { ## default to deviance based GCV score <- b$GCV;grad <- t(L)%*%b$GCV1; + } + ## dVkk only refers to smoothing parameters, but sp may contain + ## extra parameters at start and scale parameter at end. Have + ## to reduce L accordingly... + if (!is.null(family$n.theta)&&family$n.theta>0) { + ind <- 1:family$n.theta + nind <- ncol(L) - family$n.theta - if (family$n.theta + nrow(b$dVkk)0) family$n.theta+1:nind else rep(0,0) + rspind <- family$n.theta + 1:nrow(b$dVkk) + } else { + nind <- ncol(L) - if (nrow(b$dVkk)0) 1:nind else rep(0,0) ## index of smooth parameters + rspind <- 1:nrow(b$dVkk) } - L0 <- if (nrow(L)==nrow(b$dVkk)) L else L[-nrow(L),-ncol(L)] + L0 <- L[rspind,spind] ##if (nrow(L)!=nrow(b$dVkk)) L[spind,spind] else L + initial$dVkk <- diag(t(L0) %*% b$dVkk %*% L0) initial$score <- score;initial$grad <- grad; initial$scale.est <- b$scale.est @@ -2004,9 +2027,10 @@ else score.scale <- abs(trial$scale.est) + abs(trial$score) ##trial$dev/nrow(X) + abs(trial$score) uconv.ind <- abs(trial$grad) > score.scale*conv.tol if (sum(uconv.ind)) converged <- FALSE - if (length(uconv.ind)>length(trial$dVkk)) trial$dVkk <- c(trial$dVkk,score.scale) + #if (length(uconv.ind)>length(trial$dVkk)) trial$dVkk <- c(trial$dVkk,score.scale) ## following must be tighter than convergence... - uconv.ind <- abs(trial$grad) > score.scale*conv.tol*.1 | abs(trial$dVkk) > score.scale * conv.tol*.1 + uconv.ind <- abs(trial$grad) > score.scale*conv.tol*.1 + uconv.ind[spind] <- uconv.ind[spind] | abs(trial$dVkk) > score.scale * conv.tol*.1 if (abs(initial$score-trial$score) > score.scale*conv.tol) { if (!sum(uconv.ind)) uconv.ind <- uconv.ind | TRUE ## otherwise can't progress converged <- FALSE @@ -2045,10 +2069,11 @@ trial$dscore <- sum(trial$grad*step) trial$scale.est <- b$scale.est trial$dVkk <- diag(t(L0) %*% b$dVkk %*% L0) ## curvature testing matrix - if (length(uconv.ind)>length(trial$dVkk)) trial$dVkk <- c(trial$dVkk,score.scale) + #if (length(uconv.ind)>length(trial$dVkk)) trial$dVkk <- c(trial$dVkk,score.scale) rm(b);counter <- counter + 1 ## note that following rolls back until there is clear signal in derivs... - uconv.ind0 <- abs(trial$grad) > score.scale*conv.tol*20 | abs(trial$dVkk) > score.scale * conv.tol * 20 + uconv.ind0 <- abs(trial$grad) > score.scale*conv.tol*20 + uconv.ind0[spind] <- uconv.ind0[spind] | abs(trial$dVkk) > score.scale * conv.tol * 20 uconv.ind0 <- uconv.ind0 | uconv.ind ## make sure we don't start rolling back unproblematic sps } uconv.ind <- uconv.ind | TRUE diff -Nru mgcv-1.8-23/R/gam.fit4.r mgcv-1.8-24/R/gam.fit4.r --- mgcv-1.8-23/R/gam.fit4.r 2017-12-06 08:23:47.000000000 +0000 +++ mgcv-1.8-24/R/gam.fit4.r 2018-06-06 11:55:37.000000000 +0000 @@ -135,60 +135,89 @@ } } ## fetad.test -fmud.test <- function(y,mu,wt,theta,fam,eps = 1e-7) { +corb <- function(x,z) { +## alternative to cor for measuring similarity of x and z, +## which is not scaling invariant. So 1 really means x and z +## are very close, not just linearly related. + d <- x-z + 1-mean(d^2)/(sd(x)*sd(z)) +} + +fmud.test <- function(y,mu,wt,theta,fam,eps = 1e-7,plot=TRUE) { ## test family deviance derivatives w.r.t. mu - dd <- fam$Dd(y, mu, theta, wt, level=2) - dev <- fam$dev.resids(y, mu, wt,theta) - dev1 <- fam$dev.resids(y, mu+eps, wt,theta) + ## copy to make debugging easier... + Dd <- fam$Dd;dev.resids <- fam$dev.resids + dd <- Dd(y, mu, theta, wt, level=2) + dev <- dev.resids(y, mu, wt,theta) + dev1 <- dev.resids(y, mu+eps, wt,theta) Dmu.fd <- (dev1-dev)/eps - cat("Dmu: rdiff = ",range(dd$Dmu-Dmu.fd)," cor = ",cor(dd$Dmu,Dmu.fd),"\n") + cat("Dmu: rdiff = ",range(dd$Dmu-Dmu.fd)," cor = ",corb(dd$Dmu,Dmu.fd),"\n") + if (plot) { + pch <- 19;cex <- .4 + plot(dd$Dmu,Dmu.fd,pch=pch,cex=cex);abline(0,1,col=2) + oask <- devAskNewPage(TRUE) + on.exit(devAskNewPage(oask)) + } nt <- length(theta) for (i in 1:nt) { th1 <- theta;th1[i] <- th1[i] + eps - dev1 <- fam$dev.resids(y, mu, wt,th1) + dev1 <- dev.resids(y, mu, wt,th1) Dth.fd <- (dev1-dev)/eps um <- if (nt>1) dd$Dth[,i] else dd$Dth - cat("Dth[",i,"]: rdiff = ",range(um-Dth.fd)," cor = ",cor(um,Dth.fd),"\n") + cat("Dth[",i,"]: rdiff = ",range(um-Dth.fd)," cor = ",corb(um,Dth.fd),"\n") + if (plot) { plot(um,Dth.fd,pch=pch,cex=cex);abline(0,1,col=2)} } ## second order up... - dd1 <- fam$Dd(y, mu+eps, theta, wt, level=2) + dd1 <- Dd(y, mu+eps, theta, wt, level=2) Dmu2.fd <- (dd1$Dmu - dd$Dmu)/eps - cat("Dmu2: rdiff = ",range(dd$Dmu2-Dmu2.fd)," cor = ",cor(dd$Dmu2,Dmu2.fd),"\n") + cat("Dmu2: rdiff = ",range(dd$Dmu2-Dmu2.fd)," cor = ",corb(dd$Dmu2,Dmu2.fd),"\n") + if (plot) { plot(dd$Dmu2,Dmu2.fd,pch=pch,cex=cex);abline(0,1,col=2)} Dmu3.fd <- (dd1$Dmu2 - dd$Dmu2)/eps - cat("Dmu3: rdiff = ",range(dd$Dmu3-Dmu3.fd)," cor = ",cor(dd$Dmu3,Dmu3.fd),"\n") + cat("Dmu3: rdiff = ",range(dd$Dmu3-Dmu3.fd)," cor = ",corb(dd$Dmu3,Dmu3.fd),"\n") + if (plot) { plot(dd$Dmu3,Dmu3.fd,pch=pch,cex=cex);abline(0,1,col=2)} Dmu4.fd <- (dd1$Dmu3 - dd$Dmu3)/eps - cat("Dmu4: rdiff = ",range(dd$Dmu4-Dmu4.fd)," cor = ",cor(dd$Dmu4,Dmu4.fd),"\n") + cat("Dmu4: rdiff = ",range(dd$Dmu4-Dmu4.fd)," cor = ",corb(dd$Dmu4,Dmu4.fd),"\n") + if (plot) { plot(dd$Dmu4,Dmu4.fd,pch=pch,cex=cex);abline(0,1,col=2)} ## and now the higher derivs wrt theta ind <- 1:nt for (i in 1:nt) { th1 <- theta;th1[i] <- th1[i] + eps - dd1 <- fam$Dd(y, mu, th1, wt, level=2) + dd1 <- Dd(y, mu, th1, wt, level=2) Dmuth.fd <- (dd1$Dmu - dd$Dmu)/eps um <- if (nt>1) dd$Dmuth[,i] else dd$Dmuth - cat("Dmuth[",i,"]: rdiff = ",range(um-Dmuth.fd)," cor = ",cor(um,Dmuth.fd),"\n") + cat("Dmuth[",i,"]: rdiff = ",range(um-Dmuth.fd)," cor = ",corb(um,Dmuth.fd),"\n") + if (plot) { plot(um,Dmuth.fd,pch=pch,cex=cex);abline(0,1,col=2)} Dmu2th.fd <- (dd1$Dmu2 - dd$Dmu2)/eps um <- if (nt>1) dd$Dmu2th[,i] else dd$Dmu2th - cat("Dmu2th[",i,"]: rdiff = ",range(um-Dmu2th.fd)," cor = ",cor(um,Dmu2th.fd),"\n") + cat("Dmu2th[",i,"]: rdiff = ",range(um-Dmu2th.fd)," cor = ",corb(um,Dmu2th.fd),"\n") + if (plot) { plot(um,Dmu2th.fd,pch=pch,cex=cex);abline(0,1,col=2)} + if (!is.null(dd$EDmu2th)) { + EDmu2th.fd <- (dd1$EDmu2 - dd$EDmu2)/eps + um <- if (nt>1) dd$EDmu2th[,i] else dd$EDmu2th + cat("EDmu2th[",i,"]: rdiff = ",range(um-EDmu2th.fd)," cor = ",corb(um,EDmu2th.fd),"\n") + if (plot) { plot(um,EDmu2th.fd,pch=pch,cex=cex);abline(0,1,col=2)} + } Dmu3th.fd <- (dd1$Dmu3 - dd$Dmu3)/eps um <- if (nt>1) dd$Dmu3th[,i] else dd$Dmu3th - cat("Dmu3th[",i,"]: rdiff = ",range(um-Dmu3th.fd)," cor = ",cor(um,Dmu3th.fd),"\n") - + cat("Dmu3th[",i,"]: rdiff = ",range(um-Dmu3th.fd)," cor = ",corb(um,Dmu3th.fd),"\n") + if (plot) { plot(um,Dmu3th.fd,pch=pch,cex=cex);abline(0,1,col=2)} ## now the 3 second derivative w.r.t. theta terms... Dth2.fd <- (dd1$Dth - dd$Dth)/eps um <- if (nt>1) dd$Dth2[,ind] else dd$Dth2 er <- if (nt>1) Dth2.fd[,i:nt] else Dth2.fd - cat("Dth2[",i,",]: rdiff = ",range(um-er)," cor = ",cor(as.numeric(um),as.numeric(er)),"\n") - + cat("Dth2[",i,",]: rdiff = ",range(um-er)," cor = ",corb(as.numeric(um),as.numeric(er)),"\n") + if (plot) { plot(um,er,pch=pch,cex=cex);abline(0,1,col=2)} Dmuth2.fd <- (dd1$Dmuth - dd$Dmuth)/eps um <- if (nt>1) dd$Dmuth2[,ind] else dd$Dmuth2 er <- if (nt>1) Dmuth2.fd[,i:nt] else Dmuth2.fd - cat("Dmuth2[",i,",]: rdiff = ",range(um-er)," cor = ",cor(as.numeric(um),as.numeric(er)),"\n") - + cat("Dmuth2[",i,",]: rdiff = ",range(um-er)," cor = ",corb(as.numeric(um),as.numeric(er)),"\n") + if (plot) { plot(um,er,pch=pch,cex=cex);abline(0,1,col=2)} Dmu2th2.fd <- (dd1$Dmu2th - dd$Dmu2th)/eps um <- if (nt>1) dd$Dmu2th2[,ind] else dd$Dmu2th2 er <- if (nt>1) Dmu2th2.fd[,i:nt] else Dmu2th2.fd - cat("Dmu2th2[",i,",]: rdiff = ",range(um-er)," cor = ",cor(as.numeric(um),as.numeric(er)),"\n") + cat("Dmu2th2[",i,",]: rdiff = ",range(um-er)," cor = ",corb(as.numeric(um),as.numeric(er)),"\n") + if (plot) { plot(um,er,pch=pch,cex=cex);abline(0,1,col=2)} ind <- max(ind)+1:(nt-i) } } @@ -239,7 +268,8 @@ ## Now a stable re-parameterization is needed.... if (length(UrS)) { - rp <- gam.reparam(UrS,sp,deriv) + grderiv <- if (scoreType=="EFS") 1 else deriv + rp <- gam.reparam(UrS,sp,grderiv) T <- diag(q) T[1:ncol(rp$Qs),1:ncol(rp$Qs)] <- rp$Qs T <- U1%*%T ## new params b'=T'b old params @@ -258,7 +288,8 @@ rows.E <- q-Mp Sr <- cbind(rp$E,matrix(0,nrow(rp$E),Mp)) St <- rbind(cbind(rp$S,matrix(0,nrow(rp$S),Mp)),matrix(0,Mp,q)) - } else { + } else { + grderiv <- 0 T <- diag(q); St <- matrix(0,q,q) rSncol <- rows.E <- Eb <- Sr <- 0 @@ -463,13 +494,23 @@ eta <- (eta + etaold)/2 mu <- linkinv(eta) dev <- sum(dev.resids(y, mu, weights,theta)) - - pdev <- dev + t(start)%*%St%*%start ## the penalized deviance + + penalty <- t(start)%*%St%*%start + pdev <- dev + penalty ## the penalized deviance if (control$trace) cat("Step halved: new penalized deviance =", pdev, "\n") } } ## end of pdev divergence + if (scoreType=="EFS"&&family$n.theta>0) { ## there are theta parameters to estimate... + scale1 <- if (!is.null(family$scale)) family$scale else scale + if (family$n.theta>0||scale<0) theta <- estimate.theta(theta,family,y,mu,scale=scale1,wt=weights,tol=1e-7) + if (!is.null(family$scale) && family$scale<0) { + scale <- exp(theta[family$n.theta+1]) + theta <- theta[1:family$n.theta] + } + family$putTheta(theta) + } ## get new weights and pseudodata (needed now for grad testing)... dd <- dDeta(y,mu,weights,theta,family,0) ## derivatives of deviance w.r.t. eta w <- dd$Deta2 * .5; @@ -497,6 +538,11 @@ coef <- coefold <- start etaold <- eta } + if (scoreType=="EFS"&&family$n.theta>0) { + ## now recompute pdev with new theta, otherwise step control won't work at next iteration + dev <- sum(dev.resids(y, mu, weights,theta)) + old.pdev <- pdev <- dev + penalty + } } ## end of main loop ## so at this stage the model has been fully estimated @@ -553,6 +599,8 @@ } } + if (scoreType=="EFS") scoreType <- "REML" + oo <- .C(C_gdi2, X=as.double(x[good,]),E=as.double(Sr),Es=as.double(Eb),rS=as.double(unlist(rS)), U1 = as.double(U1),sp=as.double(exp(sp)),theta=as.double(theta), @@ -658,7 +706,7 @@ aic=aic.model, rank=oo$rank.est, K=Kmat,control=control, - dVkk = matrix(oo$dVkk,nSp,nSp) + dVkk = matrix(oo$dVkk,nSp,nSp),ldetS1 = if (grderiv) rp$det1 else 0 #,D1=oo$D1,D2=D2, #ldet=oo$ldet,ldet1=oo$ldet1,ldet2=ldet2, #bSb=oo$P,bSb1=oo$P1,bSb2=bSb2, @@ -669,6 +717,125 @@ +efsudr <- function(x,y,lsp,Eb,UrS,weights,family,offset=0,start=NULL,etastart=NULL,mustart=NULL, + U1=diag(ncol(x)), intercept = TRUE,scale=1,Mp=-1,control=gam.control(),n.true=-1,...) { +## Extended Fellner-Schall method for regular and extended families, +## with PIRLS performed by gam.fit3/4. +## tr(S^-S_j) is returned by ldetS1, rV %*% t(rV)*scale is +## cov matrix. I think b'S_jb will need to be computed here. + nsp <- length(UrS) + if (inherits(family,"extended.family")) { + spind <- family$n.theta + 1:nsp + thind <- 1:family$n.theta + } else { + thind <- rep(0,0) + spind <- 1:nsp ## index of smoothing params in lsp + } + estimate.scale <- (length(lsp)>max(spind)) + lsp[spind] <- lsp[spind] + 2.5 + mult <- 1 + fit <- gam.fit3(x=x, y=y, sp=lsp, Eb=Eb,UrS=UrS, + weights = weights, start = start, offset = offset,U1=U1, Mp=Mp, family = family, + control = control, intercept = intercept,deriv=0, + gamma=1,scale=scale,scoreType="EFS", + n.true=n.true,...) + if (length(thind)>0) lsp[thind] <- family$getTheta() + if (estimate.scale) lsp[length(lsp)] <- log(fit$scale) + ## Also need scale estimate. OK from gam.fit3, but gam.fit4 version probably needs correcting + ## for edf, as obtained via MLE. + p <- ncol(x) + n <- nrow(x) + score.hist <- rep(0,200) + + bSb <- trVS <- rep(0,nsp) + for (iter in 1:200) { + start <- fit$coefficients + Y <- U1[,1:(ncol(U1)-Mp)] ## penalty range space + ## project coefs and rV to Y, since this is space of UrS[[i]] + Yb <- drop(t(Y)%*%start) + rV <- t(fit$rV) ## so t(rV)%*%rV*scale is cov matrix + rVY <- rV %*% Y + ## ith penalty is UrS[[i]]%*%t(UrS[[i]])... + for (i in 1:length(UrS)) { + xx <- Yb %*% UrS[[i]] + bSb[i] <- sum(xx^2) + xx <- rVY %*% UrS[[i]] + trVS[i] <- sum(xx^2) + } + edf <- p - sum(trVS*exp(lsp[spind])) + if (inherits(family,"extended.family")&&estimate.scale) { + fit$scale <- fit$scale*n/(n-edf) ## correct for edf. + } + + a <- pmax(0,fit$ldetS1*exp(-lsp[spind]) - trVS) ## NOTE: double check scaling here + phi <- if (estimate.scale) fit$scale else scale + r <- a/pmax(0,bSb)*phi + r[a==0&bSb==0] <- 1 + r[!is.finite(r)] <- 1e6 + lsp1 <- lsp + lsp1[spind] <- pmin(lsp[spind] + log(r)*mult,control$efs.lspmax) + max.step <- max(abs(lsp1-lsp)) + old.reml <- fit$REML + fit <- gam.fit3(x=x, y=y, sp=lsp1, Eb=Eb,UrS=UrS, + weights = weights, start = start, offset = offset,U1=U1, Mp=Mp, family = family, + control = control, intercept = intercept,deriv=0,mustart=mustart, + gamma=1,scale=scale,scoreType="EFS", + n.true=n.true,...) + if (length(thind)>0) lsp1[thind] <- family$getTheta() + if (estimate.scale) lsp1[length(lsp)] <- log(fit$scale) + ## some step length control... + + if (fit$REML<=old.reml) { ## improvement + if (max.step<.05) { ## consider step extension (near optimum) + lsp2 <- lsp + lsp2[spind] <- pmin(lsp[spind] + log(r)*mult*2,control$efs.lspmax) ## try extending step... + fit2 <- gam.fit3(x=x, y=y, sp=lsp2, Eb=Eb,UrS=UrS, + weights = weights, start = start, offset = offset,U1=U1, Mp=Mp, family = family, + control = control, intercept = intercept,deriv=0,mustart=mustart, + gamma=1,scale=scale,scoreType="EFS", + n.true=n.true,...) + if (length(thind)>0) lsp2[thind] <- family$getTheta() + if (estimate.scale) lsp2[length(lsp)] <- log(fit$scale) + if (fit2$REML < fit$REML) { ## improvement - accept extension + fit <- fit2;lsp <- lsp2 + mult <- mult * 2 + } else { ## accept old step + lsp <- lsp1 + } + } else lsp <- lsp1 + } else { ## no improvement + while (fit$REML > old.reml&&mult>1) { ## don't contract below 1 as update doesn't have to improve REML + mult <- mult/2 ## contract step + lsp1 <- lsp + lsp1[spind] <- pmin(lsp[spind] + log(r)*mult,control$efs.lspmax) + fit <- gam.fit3(x=x, y=y, sp=lsp1, Eb=Eb,UrS=UrS, + weights = weights, start = start, offset = offset,U1=U1, Mp=Mp, family = family, + control = control, intercept = intercept,deriv=0,mustart=mustart, + gamma=1,scale=scale,scoreType="EFS", + n.true=n.true,...) + if (length(thind)>0) lsp1[thind] <- family$getTheta() + if (estimate.scale) lsp1[length(lsp)] <- log(fit$scale) + } + lsp <- lsp1 + if (mult<1) mult <- 1 + } + score.hist[iter] <- fit$REML + ## break if EFS step small and REML change negligible over last 3 steps. + if (iter>3 && max.step<.05 && max(abs(diff(score.hist[(iter-3):iter])))=ll0) { + if (is.finite(ll1)&&ll1>=ll0) { ll <- llf(y,x,coef1,weights,family,offset=offset,deriv=1) } else { ## abort if step has made no difference if (max(abs(coef1-coef))==0) khalf <- 100 @@ -828,7 +995,7 @@ step <- step/10;coef1 <- coef + step ll <- llf(y,x,coef1,weights,family,offset=offset,deriv=0) ll1 <- ll$l - (t(coef1)%*%St%*%coef1)/2 - if (ll1>=ll0) { + if (is.finite(ll1)&&ll1>=ll0) { ll <- llf(y,x,coef1,weights,family,offset=offset,deriv=1) } else { ## abort if step has made no difference if (max(abs(coef1-coef))==0) khalf <- 100 @@ -1091,7 +1258,7 @@ efsud <- function(x,y,lsp,Sl,weights=NULL,offset=NULL,family, control=gam.control(),Mp=-1,start=NULL) { -## Extended Fellner-Schall method +## Extended Fellner-Schall method for general families ## tr(S^-S_j) is returned by ldetS as ldet1 - S1 from gam.fit5 ## b'S_jb is computed as d1bSb in gam.fit5 ## tr(V S_j) will need to be computed using Sl.termMult @@ -1131,14 +1298,15 @@ r <- a/pmax(0,bSb) r[a==0&bSb==0] <- 1 r[!is.finite(r)] <- 1e6 - lsp1 <- pmin(lsp + log(r)*mult,12) + lsp1 <- pmin(lsp + log(r)*mult,control$efs.lspmax) + max.step <- max(abs(lsp1-lsp)) old.reml <- fit$REML fit <- gam.fit5(x=x,y=y,lsp=lsp1,Sl=Sl,weights=weights,offset=offset,deriv=0, family=family,control=control,Mp=Mp,start=start,gamma=1) ## some step length control... if (fit$REML<=old.reml) { ## improvement - if (max(abs(log(r))<.05)) { ## consider step extension + if (max.step<.05) { ## consider step extension lsp2 <- pmin(lsp + log(r)*mult*2,12) ## try extending step... fit2 <- gam.fit5(x=x,y=y,lsp=lsp2,Sl=Sl,weights=weights,offset=offset,deriv=0,family=family, control=control,Mp=Mp,start=start,gamma=1) @@ -1153,7 +1321,7 @@ } else { ## no improvement while (fit$REML > old.reml&&mult>1) { ## don't contract below 1 as update doesn't have to improve REML mult <- mult/2 ## contract step - lsp1 <- pmin(lsp + log(r)*mult,12) + lsp1 <- pmin(lsp + log(r)*mult,control$efs.lspmax) fit <- gam.fit5(x=x,y=y,lsp=lsp1,Sl=Sl,weights=weights,offset=offset,deriv=0,family=family, control=control,Mp=Mp,start=start,gamma=1) } @@ -1161,8 +1329,11 @@ if (mult<1) mult <- 1 } score.hist[iter] <- fit$REML + ## break if EFS step small and REML change negligible over last 3 steps. + if (iter>3 && max.step<.05 && max(abs(diff(score.hist[(iter-3):iter])))0) G$cmX[-(1:G$nsdf)] <- 0 ## zero the smooth parts here - else G$cmX <- G$cmX * 0 + ## cmX relates to computation of CIs incorportating uncertainty about the mean + ## It may make more sense to incorporate all uncertainty about the mean, + ## rather than just the uncertainty in the fixed effects mean. This means + ## incorporating the mean of random effects and unconstrained smooths. Hence + ## comment out the following. + #if (G$nsdf>0) G$cmX[-(1:G$nsdf)] <- 0 ## zero the smooth parts here + #else G$cmX <- G$cmX * 0 G$X <- X;rm(X) n.p <- ncol(G$X) # deal with penalties @@ -1436,10 +1443,10 @@ if (optimizer[2]%in%c("nlm.fd")) .Deprecated(msg=paste("optimizer",optimizer[2],"is deprecated, please use newton or bfgs")) - if (optimizer[1]=="efs" && !inherits(family,"general.family")) { - warning("Extended Fellner Schall only implemented for general families") - optimizer <- c("outer","newton") - } +# if (optimizer[1]=="efs" && !inherits(family,"general.family")) { +# warning("Extended Fellner Schall only implemented for general families") +# optimizer <- c("outer","newton") +# } if (length(lsp)==0) { ## no sp estimation to do -- run a fit instead optimizer[2] <- "no.sps" ## will cause gam2objective to be called, below @@ -1469,8 +1476,15 @@ if (optimizer[1]=="efs"&& optimizer[2] != "no.sps" ) { ## experimental extended efs ##warning("efs is still experimental!") - object <- efsud(x=G$X,y=G$y,lsp=lsp,Sl=G$Sl,weights=G$w,offset=G$offxset,family=family, + if (inherits(family,"general.family")) { + object <- efsud(x=G$X,y=G$y,lsp=lsp,Sl=G$Sl,weights=G$w,offset=G$offxset,family=family, control=control,Mp=G$Mp,start=start) + } else { + family <- fix.family.ls(family) + object <- efsudr(x=G$X,y=G$y,lsp=lsp,Eb=G$Eb,UrS=G$UrS,weights=G$w,family=family,offset=G$offset, + start=start, + U1=G$U1, intercept = TRUE,scale=scale,Mp=G$Mp,control=control,n.true=G$n.true,...) + } object$gcv.ubre <- object$REML } else if (optimizer[2]=="newton"||optimizer[2]=="bfgs"){ ## the gam.fit3 method if (optimizer[2]=="bfgs") @@ -1596,6 +1610,7 @@ } if (!optimizer[1]%in%c("perf","outer","efs")) stop("unknown optimizer") + if (optimizer[1]=="efs") method <- "REML" if (!method%in%c("GCV.Cp","GACV.Cp","REML","P-REML","ML","P-ML")) stop("unknown smoothness selection criterion") G$family <- fix.family(G$family) G$rS <- mini.roots(G$S,G$off,ncol(G$X),G$rank) @@ -2085,7 +2100,7 @@ mgcv.tol=1e-7,mgcv.half=15,trace =FALSE, rank.tol=.Machine$double.eps^0.5, nlm=list(),optim=list(),newton=list(),outerPIsteps=0, - idLinksBases=TRUE,scalePenalty=TRUE, + idLinksBases=TRUE,scalePenalty=TRUE,efs.lspmax=15,efs.tol=.1, keepData=FALSE,scale.est="fletcher",edge.correct=FALSE) # Control structure for a gam. # irls.reg is the regularization parameter to use in the GAM fitting IRLS loop. @@ -2138,12 +2153,13 @@ # and optim defaults if (is.null(optim$factr)) optim$factr <- 1e7 optim$factr <- abs(optim$factr) + if (efs.tol<=0) efs.tol <- .1 list(nthreads=round(nthreads),irls.reg=irls.reg,epsilon = epsilon, maxit = maxit, trace = trace, mgcv.tol=mgcv.tol,mgcv.half=mgcv.half, rank.tol=rank.tol,nlm=nlm, optim=optim,newton=newton,outerPIsteps=outerPIsteps, - idLinksBases=idLinksBases,scalePenalty=scalePenalty, + idLinksBases=idLinksBases,scalePenalty=scalePenalty,efs.lspmax=efs.lspmax,efs.tol=efs.tol, keepData=as.logical(keepData[1]),scale.est=scale.est,edge.correct=edge.correct) } @@ -2509,7 +2525,7 @@ predict.gam <- function(object,newdata,type="link",se.fit=FALSE,terms=NULL,exclude=NULL, block.size=NULL,newdata.guaranteed=FALSE,na.action=na.pass, - unconditional=FALSE,...) { + unconditional=FALSE,iterms.type=NULL,...) { # This function is used for predicting from a GAM. 'object' is a gam object, newdata a dataframe to # be used in prediction...... @@ -2663,7 +2679,12 @@ msg <- paste(paste(levn[!levn%in%levm],collapse=", "),"not in original fit",collapse="") stop(msg) } - newdata[[i]] <- factor(newdata[[i]],levels=levm) # set prediction levels to fit levels + ## set prediction levels to fit levels... + if (is.matrix(newdata[[i]])) { + dum <- factor(newdata[[i]],levels=levm) + dim(dum) <- dim(newdata[[i]]) + newdata[[i]] <- dum + } else newdata[[i]] <- factor(newdata[[i]],levels=levm) } if (type=="newdata") return(newdata) @@ -2851,6 +2872,7 @@ if (type=="iterms"&& attr(object$smooth[[k]],"nCons")>0) { ## termwise se to "carry the intercept ## some general families, add parameters after cmX created, which are irrelevant to cmX... if (length(object$cmX) < ncol(X)) object$cmX <- c(object$cmX,rep(0,ncol(X)-length(object$cmX))) + if (!is.null(iterms.type)&&iterms.type==2) object$cmX[-(1:object$nsdf)] <- 0 ## variability of fixed effects mean only X1 <- matrix(object$cmX,nrow(X),ncol(X),byrow=TRUE) meanL1 <- object$smooth[[k]]$meanL1 if (!is.null(meanL1)) X1 <- X1 / meanL1 diff -Nru mgcv-1.8-23/R/plots.r mgcv-1.8-24/R/plots.r --- mgcv-1.8-23/R/plots.r 2017-11-13 11:36:11.000000000 +0000 +++ mgcv-1.8-24/R/plots.r 2018-05-15 07:57:44.000000000 +0000 @@ -1,4 +1,4 @@ -## R plotting routines for the package mgcv (c) Simon Wood 2000-2017 +# R plotting routines for the package mgcv (c) Simon Wood 2000-2017 ## With contributions from Henric Nilsson @@ -1247,6 +1247,7 @@ ## test whether mean variability to be added to variability (only for centred terms) if (seWithMean && attr(x$smooth[[i]],"nCons")>0) { if (length(x$cmX) < ncol(x$Vp)) x$cmX <- c(x$cmX,rep(0,ncol(x$Vp)-length(x$cmX))) + if (seWithMean==2) x$cmX[-(1:x$nsdf)] <- 0 ## variability of fixed effects mean only X1 <- matrix(x$cmX,nrow(P$X),ncol(x$Vp),byrow=TRUE) meanL1 <- x$smooth[[i]]$meanL1 if (!is.null(meanL1)) X1 <- X1 / meanL1 @@ -1297,17 +1298,6 @@ } else { ppp<-1;oldpar<-par()} - if ((pages==0&&prod(par("mfcol"))1&&dev.interactive()) ask <- TRUE else ask <- FALSE - - if (!is.null(select)) { - ask <- FALSE - } - - if (ask) { - oask <- devAskNewPage(TRUE) - on.exit(devAskNewPage(oask)) - } ##################################### ## get a common scale, if required... @@ -1347,11 +1337,28 @@ ## now plot smooths, by calling plot methods with plot data... ############################################################## + if ((pages==0&&prod(par("mfcol"))1&&dev.interactive()) ask <- TRUE else ask <- FALSE + + if (!is.null(select)) { + ask <- FALSE + } + +# if (ask) { ## asks before plotting +# oask <- devAskNewPage(TRUE) +# on.exit(devAskNewPage(oask)) +# } + if (m>0) for (i in 1:m) if (pd[[i]]$plot.me&&(is.null(select)||i==select)) { plot(x$smooth[[i]],P=pd[[i]],partial.resids=partial.resids,rug=rug,se=se,scale=scale,n=n,n2=n2,n3=n3, pers=pers,theta=theta,phi=phi,jit=jit,xlab=xlab,ylab=ylab,main=main, ylim=ylim,xlim=xlim,too.far=too.far,shade=shade,shade.col=shade.col, shift=shift,trans=trans,by.resids=by.resids,scheme=scheme[i],...) + if (ask) { ## this is within loop so we don't get asked before it's necessary + oask <- devAskNewPage(TRUE) + on.exit(devAskNewPage(oask)) + ask <- FALSE ## only need to do this once + } } ## end of smooth plotting loop diff -Nru mgcv-1.8-23/R/smooth.r mgcv-1.8-24/R/smooth.r --- mgcv-1.8-23/R/smooth.r 2017-11-16 19:03:42.000000000 +0000 +++ mgcv-1.8-24/R/smooth.r 2018-06-11 10:47:07.000000000 +0000 @@ -332,7 +332,7 @@ ismat <- FALSE } else ismat <- TRUE } else ismat <- FALSE - if (vecMat&&is.matrix(x)) x <- as.numeric(x) + if (vecMat&&is.matrix(x)) x <- x[1:prod(dim(x))] ## modified from x <- as.numeric(x) to allow factors if (ismat) attr(x,"matrix") <- TRUE x } ## get.var @@ -2545,7 +2545,14 @@ if (is.null(object$xt$nb)) { ## no neighbour list... construct one if (is.null(object$xt$polys)) stop("no spatial information provided!") object$xt$nb <- pol2nb(object$xt$polys)$nb - } ## now have a neighbour list + } else if (!is.numeric(object$xt$nb[[1]])) { ## user has (hopefully) supplied names not indices + nb.names <- names(object$xt$nb) + for (i in 1:length(nb.names)) { + object$xt$nb[[i]] <- which(nb.names %in% object$xt$nb[[i]]) + } + } + + ## now have a neighbour list a.name <- names(object$xt$nb) if (all.equal(sort(a.name),sort(levels(k)))!=TRUE) stop("mismatch between nb/polys supplied area names and data area names") @@ -3656,10 +3663,10 @@ sml[[1]]$X <- as.numeric(by)*sm$X ## normal `by' handling ## Now do the summation stuff.... ind <- 1:n - X <- sml[[1]]$X[ind,] + X <- sml[[1]]$X[ind,,drop=FALSE] for (i in 2:q) { ind <- ind + n - X <- X + sml[[1]]$X[ind,] + X <- X + sml[[1]]$X[ind,,drop=FALSE] } sml[[1]]$X <- X if (!is.null(offs)) { ## deal with any term specific offset (i.e. sum it too) @@ -3739,15 +3746,15 @@ if (length(sm$S)>0) for (l in 1:length(sm$S)) # some smooths have > 1 penalty { ZSZ <- sml[[i]]$S[[l]] - ZSZ[indi[1:nz],]<-qr.qty(qrc,sml[[i]]$S[[l]][indi,,drop=FALSE])[(nc+1):nx,] + if (nz>0) ZSZ[indi[1:nz],]<-qr.qty(qrc,sml[[i]]$S[[l]][indi,,drop=FALSE])[(nc+1):nx,] ZSZ <- ZSZ[-indi[(nz+1):nx],] - ZSZ[,indi[1:nz]]<-t(qr.qty(qrc,t(ZSZ[,indi,drop=FALSE]))[(nc+1):nx,]) + if (nz>0) ZSZ[,indi[1:nz]]<-t(qr.qty(qrc,t(ZSZ[,indi,drop=FALSE]))[(nc+1):nx,]) sml[[i]]$S[[l]] <- ZSZ[,-indi[(nz+1):nx],drop=FALSE] ## Z'SZ ## ZSZ<-qr.qty(qrc,sm$S[[l]])[(j+1):k,] ## sml[[i]]$S[[l]]<-t(qr.qty(qrc,t(ZSZ))[(j+1):k,]) ## Z'SZ } - sml[[i]]$X[,indi[1:nz]]<-t(qr.qty(qrc,t(sml[[i]]$X[,indi,drop=FALSE]))[(nc+1):nx,]) + if (nz>0) sml[[i]]$X[,indi[1:nz]]<-t(qr.qty(qrc,t(sml[[i]]$X[,indi,drop=FALSE]))[(nc+1):nx,]) sml[[i]]$X <- sml[[i]]$X[,-indi[(nz+1):nx]] ## sml[[i]]$X<-t(qr.qty(qrc,t(sml[[i]]$X))[(j+1):k,]) ## form XZ attr(sml[[i]],"qrc") <- qrc @@ -4025,11 +4032,11 @@ nc <- j;nz <- nx - nc if (sum(is.na(X))) { ind <- !is.na(rowSums(X)) - X[ind,indi[1:nz]]<-t(qr.qty(qrc,t(X[ind,indi,drop=FALSE]))[(nc+1):nx,]) + if (nz>0) X[ind,indi[1:nz]]<-t(qr.qty(qrc,t(X[ind,indi,drop=FALSE]))[(nc+1):nx,]) X <- X[,-indi[(nz+1):nx]] X[!ind,] <- NA } else { - X[,indi[1:nz]]<-t(qr.qty(qrc,t(X[,indi,drop=FALSE]))[(nc+1):nx,,drop=FALSE]) + if (nz>0) X[,indi[1:nz]]<-t(qr.qty(qrc,t(X[,indi,drop=FALSE]))[(nc+1):nx,,drop=FALSE]) X <- X[,-indi[(nz+1):nx]] } } diff -Nru mgcv-1.8-23/src/coxph.c mgcv-1.8-24/src/coxph.c --- mgcv-1.8-23/src/coxph.c 2018-01-08 15:15:43.000000000 +0000 +++ mgcv-1.8-24/src/coxph.c 2018-06-18 13:08:20.000000000 +0000 @@ -17,7 +17,7 @@ #include "mgcv.h" -void coxpred(double *X,double *t,double *beta,double *Vb,double *a,double *h,double *q, +void coxpred(double *X,double *t,double *beta,double *off,double *Vb,double *a,double *h,double *q, double *tr,int *n,int *p, int *nt,double *s,double *se) { /* Function to predict the survivor function for the new data in X (n by p), t, given fit results in a, h, q, Vb, and original event times @@ -43,7 +43,7 @@ eta += *p1 * *p3; /* X beta */ *pv = *pa - *p1 * hi; /* v = a - x * h */ } - exp_eta = exp(eta); + exp_eta = exp(eta+off[i]); s[i] = exp(-hi*exp_eta); /* estimated survivor function */ /* now get the s.e. for this... */ p1 = Vb;pv = v;p2 = pv + *p; diff -Nru mgcv-1.8-23/src/init.c mgcv-1.8-24/src/init.c --- mgcv-1.8-23/src/init.c 2018-01-08 15:15:43.000000000 +0000 +++ mgcv-1.8-24/src/init.c 2018-06-18 13:08:20.000000000 +0000 @@ -34,7 +34,7 @@ {"vcorr", (DL_FUNC) &vcorr, 5}, {"dchol", (DL_FUNC) &dchol, 4}, {"mgcv_omp", (DL_FUNC) &mgcv_omp, 1}, - {"coxpred", (DL_FUNC) &coxpred, 13}, + {"coxpred", (DL_FUNC) &coxpred, 14}, {"coxpp", (DL_FUNC) &coxpp, 10}, {"coxlpl", (DL_FUNC) &coxlpl, 17}, {"mvn_ll", (DL_FUNC) &mvn_ll,15}, diff -Nru mgcv-1.8-23/src/mgcv.h mgcv-1.8-24/src/mgcv.h --- mgcv-1.8-23/src/mgcv.h 2018-01-08 15:15:43.000000000 +0000 +++ mgcv-1.8-24/src/mgcv.h 2018-06-18 13:08:20.000000000 +0000 @@ -63,7 +63,7 @@ /* cox model routines */ -void coxpred(double *X,double *t,double *beta,double *Vb,double *a,double *h,double *q, +void coxpred(double *X,double *t,double *beta,double *off,double *Vb,double *a,double *h,double *q, double *tr,int *n,int *p, int *nt,double *s,double *se); void coxpp(double *eta,double *X,int *r, int *d,double *h,double *q,double *km, int *n,int *p, int *nt);