Commit e252c2ab authored by Dirk Eddelbuettel's avatar Dirk Eddelbuettel

Import Upstream version 1.7-21

parent f31b3bf5
Package: mgcv
Version: 1.7-20
Version: 1.7-21
Author: Simon Wood <>
Maintainer: Simon Wood <>
Title: Mixed GAM Computation Vehicle with GCV/AIC/REML smoothness
......@@ -14,6 +14,6 @@ Suggests: nlme (>= 3.1-64), splines, Matrix, parallel
LazyLoad: yes
ByteCompile: yes
License: GPL (>= 2)
Packaged: 2012-08-24 09:38:21 UTC; sw283
Packaged: 2012-09-18 14:17:12 UTC; sw283
Repository: CRAN
Date/Publication: 2012-08-24 19:00:39
Date/Publication: 2012-09-18 14:45:44
7b0afac092bc0b2f4a344d67a1c7eaf0 *DESCRIPTION
50152051f123a389d421aa3130dce252 *NAMESPACE
d164cab90e6024a6942dba6de5352cae *DESCRIPTION
3e152f2a5b0efaa9f28a3a976ed087e4 *NAMESPACE
7b5db03a3a80878eb8007f8c0848583a *R/bam.r
e59ee1842b4546cb64ebe39e6a7f00ee *R/fast-REML.r
2073e50d30aacc57abac1db8b3133467 *R/gam.fit3.r
902657a0ee2dedc3fdfa501bf3b37c5b *R/gam.sim.r
3527e64fa9d32baba5644c69c7d1eaf6 *R/gamm.r
7abad0459a93e7e451e018d0109612a8 *R/mgcv.r
1a5634ab06b9f0bd68fd86e489e9c864 *R/plots.r
d16c7de3c76cfbc1dfc418f49bc94eb5 *R/smooth.r
8b4c61012d19bfd07321cc17fc4f9927 *R/plots.r
7223c8dcb8d3778f061848dd020558cc *R/smooth.r
484800e6369585d11f6c7aef7631d9b0 *R/soap.r
fb66d6c18398411a99ffcb788b854f13 *R/sparse.r
7a549e348bd9f2eeb51dccb1dc5de6d4 *changeLog
a7e1bf5114a392453948022894bbed0e *changeLog
e468195a83fab90da8e760c2c3884bd3 *data/columb.polys.rda
40874e3ced720a596750f499ded8a60a *data/columb.rda
88d77139cc983317b6acd8c5f1252ab9 *gnugpl2.txt
......@@ -17,6 +18,7 @@ f693920e12f8a6f2b6cab93648628150 *index
9388a0979dab4fe1988b777ae4dcfb0a *inst/CITATION
5bf12ddc0dab9daae72271b96a15c539 *man/Predict.matrix.Rd
c51c9b8c9c73f81895176ded39b91394 *man/
e9b0a2e31b130cf2cb38618ec50d1919 *man/
3e5e30b44947d3ddf00fcd55be219038 *man/Tweedie.Rd
0d24940b2e0a3e9fa7b3dc0224d049ab *man/anova.gam.Rd
585d6b6a2e7816df83d5f9193195a233 *man/bam.Rd
......@@ -31,6 +33,7 @@ f764fb7cb9e63ff341a0075a3854ab5d *man/exclude.too.far.Rd
4d4eea9ad2b78e765a96b2a0065725c1 *man/fixDependence.Rd
9ac808f5a2a43cf97f24798c0922c9bf *man/formXtViX.Rd
bb099e6320a6c1bd79fe4bf59e0fde08 *man/formula.gam.Rd
4da4d585b329769eb44f0c7a6e7dd554 *man/fs.test.Rd
6f405acde2d7b6f464cf45f5395113ba *man/full.score.Rd
d7781fc09ad742a63746ea92a927eee4 *man/gam.Rd
fe61dd0efab9e920c17335faf3d5764c *man/gam.check.Rd
......@@ -49,6 +52,7 @@ a66a814cc4c6f806e824751fda519ae0 *man/gam2objective.Rd
9c301060b3c35bc6ab83e6f38ce8d3b6 *man/gamm.Rd
1f5d723f2fa931297940e1a4a840d792 *man/get.var.Rd
a2ea1233d43fac89e0cacbc09a8d31e2 *man/in.out.Rd
9c461959be1272edcb98ee7e20fdc317 *man/inSide.Rd
2f222eeeb3d7bc42f93869bf8c2af58a *man/influence.gam.Rd
bafea2eef12fdc819f8ac1fb41d8b914 *man/initial.sp.Rd
aba56a0341ba9526a302e39d33aa9042 *man/interpret.gam.Rd
......@@ -59,7 +63,7 @@ aba56a0341ba9526a302e39d33aa9042 *man/interpret.gam.Rd
396548e4a40652c54e80751acbfb2e2c *man/magic.Rd
496388445d8cde9b8e0c3917cbe7461d *man/
9427464e63d70da15fc468961ef0c29b *man/mgcv-FAQ.Rd
41df245a5821b3964db4c74b1930c0fe *man/mgcv-package.Rd
42cc4e7dcfa64979db73c672980ac9b1 *man/mgcv-package.Rd
18a9858b6f3ffde288b0bf9e1a5da2f6 *man/model.matrix.gam.Rd
bc9b89db7e7ff246749551c16f5f1f07 *man/mono.con.Rd
3a4090ac778273861d97077681a55df2 *man/mroot.Rd
......@@ -93,10 +97,11 @@ c07b9d5733913e8397a91bd2526f0d23 *man/
772e6c18d25cfaf3d9c194031ee042fe *man/smooth.construct.mrf.smooth.spec.Rd
65f84caf46cc1abbfa8ef8d9f3b7bbe2 *man/
d202c6718fb1138fdd99e6102250aedf *man/
87931bec091f3f0570b60d0dea7f10e0 *man/
53d7986dd7a54c1edb13ce84dbfe34a2 *man/smooth.construct.sos.smooth.spec.Rd
8672633a1fad8df3cb1f53d7fa883620 *man/smooth.construct.tensor.smooth.spec.Rd
76ca359e3eda6e32398da0d6cdf9903b *man/
1de9c315702476fd405a85663bb32d1c *man/smooth.terms.Rd
aad11653a5d7c05ea4d3ad96dda42273 *man/smooth.terms.Rd
0d12daea17e0b7aef8ab89b5f801adf1 *man/smoothCon.Rd
5ae47a140393009e3dba7557af175170 *man/sp.vcov.Rd
83bd8e097711bf5bd0fff09822743d43 *man/spasm.construct.Rd
......@@ -111,24 +116,27 @@ fbd45cbb1931bdb5c0de044e22fdd028 *man/uniquecombs.Rd
becbe3e1f1588f7292a74a97ef07a9ae *po/R-de.po
0bdfcf98961b0d52b60f806dc1dba77e *po/R-en@quot.po
9126ed91030cd1c168d669854cf1f510 *po/R-fr.po
756303bf89ba1b0da99771c0850de3c3 *po/R-mgcv.pot
8f9a840ad1b968f05e39042aba43792e *po/R-mgcv.pot
d5a0f198090ecbfedaa6549f2918b997 *po/R-po.po
3550a794504bdfd4f75a83de1148bb40 *po/de.po
93f72334356fe6f05a64e567efd35c8e *po/en@quot.po
1a4a267ddcb87bb83f09c291d3e97523 *po/fr.po
813514ea4e046ecb4563eb3ae8aa202a *po/mgcv.pot
749ac663240fd6eaa2b725602d47ef2a *po/po.po
cd54024d76a9b53dc17ef26323fc053f *src/Makevars
94a2bcbb75cc60e8460e72ed154678c9 *src/gdi.c
49af97195accb65adc75620183d39a4c *src/general.h
6f301e977834b4743728346184ea11ba *src/init.c
227ab8e09ea73b4c3a68069d8e2dca74 *src/init.c
1635205c9d5bb9a5713663775f47fd2a *src/magic.c
066af9db587e5fe6e5cc4ff8c09ae9c2 *src/mat.c
de0ae24ea5cb533640a3ab57e0383595 *src/matrix.c
0f8448f67d16668f9027084a2d9a1b52 *src/matrix.h
6a9f57b44d2aab43aa32b01ccb26bd6e *src/mgcv.c
9a7ab05c053c7e1cb03148863d0980cb *src/mgcv.h
fd0b2cb110575b93a7d826b25226f12b *src/mgcv.h
fcbe85d667f8c7818d17509a0c3c5935 *src/misc.c
7e0ba698a21a01150fda519661ef9857 *src/qp.c
cd563899be5b09897d1bf36a7889caa0 *src/qp.h
3236a7cbc7030edbd6f1ebc3563c9faa *src/soap.c
e9cab4a461eb8e086a0e4834cbf16f30 *src/sparse-smooth.c
985ef1e19c7b5d97b8e29ed78e709fc5 *src/tprs.c
5352d5d2298acd9b03ee1895933d4fb4 *src/tprs.h
......@@ -4,11 +4,11 @@ export(anova.gam, bam, bam.update, concurvity, cSplineDes,
exclude.too.far,extract.lme.cov, extract.lme.cov2,
formXtViX, full.score, formula.gam,fixDependence,,,,,,
gam, gam2derivative,
fs.test,fs.boundary,gam, gam2derivative,
gamm, gam.check, gam.control,gam.fit3,, gam.outer,gam.vcomp, gamSim , influence.gam,
......@@ -27,6 +27,9 @@ export(anova.gam, bam, bam.update, concurvity, cSplineDes,
......@@ -46,6 +49,9 @@ export(anova.gam, bam, bam.update, concurvity, cSplineDes,,
......@@ -671,7 +671,9 @@ plot.mgcv.smooth <- function(x,P=NULL,data=NULL,label="",se1.mult=1,se2.mult=2,
shift=0,trans=I,by.resids=FALSE,scheme=0,...) {
## default plot method for smooth objects `x' inheriting from "mgcv.smooth"
## `x' is a smooth object, usually part of a `gam' fit.
## `x' is a smooth object, usually part of a `gam' fit. It has an attribute
## 'coefficients' containg the coefs for the smooth, but usually these
## are not needed.
## `P' is a list of plot data.
## If `P' is NULL then the routine should compute some of this plot data
## and return without plotting...
......@@ -684,6 +686,9 @@ plot.mgcv.smooth <- function(x,P=NULL,data=NULL,label="",se1.mult=1,se2.mult=2,
## y scale is required.
## * any raw data information.
## * axis labels and plot titles
## As an alternative, P may contain a 'fit' field directly, in which case the
## very little processing is done outside the routine, except for partial residual
## computations.
## Alternatively return P as NULL if x should not be plotted.
## If P is not NULL it will contain
## * fit - the values for plotting
......@@ -1036,13 +1041,14 @@ plot.gam <- function(x,residuals=FALSE,rug=TRUE,se=TRUE,pages=0,select=NULL,scal
term.lab <- sub.edf(x$smooth[[i]]$label,edf)
#P <- plot(x$smooth[[i]],P=NULL,data=x$model,n=n,n2=n2,xlab=xlab,ylab=ylab,too.far=too.far,label=term.lab,
# se1.mult=se1.mult,se2.mult=se2.mult,xlim=xlim,ylim=ylim,main=main,scheme=scheme[i],...)
attr(x$smooth[[i]],"coefficients") <- x$coefficients[first:last] ## relevent coefficients
P <- plot(x$smooth[[i]],P=NULL,data=x$model,partial.resids=partial.resids,rug=rug,se=se,scale=scale,n=n,n2=n2,
if (is.null(P)) pd[[i]] <- list( else {
if (is.null(P)) pd[[i]] <- list( else if (is.null(P$fit)) {
p <- x$coefficients[first:last] ## relevent coefficients
offset <- attr(P$X,"offset") ## any term specific offset
## get fitted values ....
......@@ -1065,7 +1071,11 @@ plot.gam <- function(x,residuals=FALSE,rug=TRUE,se=TRUE,pages=0,select=NULL,scal
P$ <- TRUE
pd[[i]] <- P;rm(P)
} ## plot data setup complete
} else { ## P$fit created directly
if (partial.resids) { P$p.resid <- fv.terms[,length(order)+i] + w.resid }
P$ <- TRUE
pd[[i]] <- P;rm(P)
} ## end of data setup loop through smooths
......@@ -2422,7 +2422,7 @@ DuchonE <- function(x,xk,m=2,s=0,n=1) {
smooth.construct.ds.smooth.spec <- function(object,data,knots)
## The constructor for a Duchon 1977 smoother
{ ## deal with possible extra arguments of "sos" type smooth
xtra <- list()
......@@ -2620,6 +2620,10 @@ Predict.matrix.duchon.spline <- function(object,data)
} ## end of Predict.matrix.duchon.spline
# Soap film smoothers
......@@ -3226,84 +3230,3 @@ PredictMat <- function(object,data,n=nrow(data))
PredictMat.old <- function(object,data,n=nrow(data))
## wrapper function which calls Predict.matrix and imposes same constraints as
## smoothCon on resulting Prediction Matrix
## This version is very memory intensive if summation convention is needed
{ X <- Predict.matrix2(object,data)
if (is.null(attr(X,"by.done"))) { ## handle `by variables'
if (object$by!="NA") # deal with "by" variable
{ by <- get.var(object$by,data)
if (is.null(by)) stop("Can't find by variable")
if (is.factor(by)) {
by.dum <- as.numeric(object$by.level==by)
X <- by.dum*X
} else {
if (length(by)!=nrow(X)) stop("`by' variable must be same dimension as smooth arguments")
X <- as.numeric(by)*X
attr(X,"by.done") <- NULL
offset <- attr(X,"offset")
## now deal with any necessary model matrix summation
if (n != nrow(X)) {
q <- nrow(X)/n ## note: can't get here if `by' a factor
ind <- 1:n
Xs <- X[ind,]
for (i in 2:q) {
ind <- ind + n
Xs <- Xs + X[ind,]
X <- Xs
qrc <- attr(object,"qrc")
if (!is.null(qrc)) { ## then smoothCon absorbed constraints
j <- attr(object,"nCons")
if (j>0) { ## there were constraints to absorb - need to untransform
if (inherits(qrc,"qr")) {
indi <- attr(object,"indi") ## index of constrained parameters
if (is.null(indi)) {
if (sum( {
ind <- !
X1 <- t(qr.qty(qrc,t(X[ind,,drop=FALSE]))[(j+1):k,,drop=FALSE]) ## XZ
X <- matrix(NA,nrow(X),ncol(X1))
X[ind,] <- X1
} else {
X <- t(qr.qty(qrc,t(X))[(j+1):k,,drop=FALSE])
} else { ## only some parameters are subject to constraint
nx <- length(indi)
nc <- j;nz <- nx - nc
if (sum( {
ind <- !
X <- X[,-indi[(nz+1):nx]]
X[!ind,] <- NA
} else {
X <- X[,-indi[(nz+1):nx]]
} else if (inherits(qrc,"sweepDrop")) {
## Sweep and drop constraints. First element is index to drop.
## Remainder are constants to be swept out of remaining columns
## X <- sweep(X[,-qrc[1],drop=FALSE],2,qrc[-1])
X <- X[,-qrc[1],drop=FALSE] - matrix(qrc[-1],nrow(X),ncol(X)-1,byrow=TRUE)
} else if (qrc>0) { ## simple set to zero constraint
X <- X[,-qrc]
} else if (qrc<0) { ## params sum to zero
X <- t(diff(t(X)))
## drop columns eliminated by side-conditions...
del.index <- attr(object,"del.index")
if (!is.null(del.index)) X <- X[,-del.index]
attr(X,"offset") <- offset
} ## end of PredictMat.old
This diff is collapsed.
......@@ -3,15 +3,26 @@
* F needed in gam object?
* still not really happy with nesting constraints, especially under rank
** soap film smoother class added. See ?soap
* Polish translation added thanks to Lukasz Daniel.
* mgcv/po/R-mgcv.pot up-dated.
* plot methods for smooths modified slightly to allow methods to return
plot data directly, without a prediction matrix.
* '...' now passd to termplot by plot.gam (thanks Andreas Eckner).
* '...' now passed to termplot by plot.gam (thanks Andreas Eckner).
* fix to null deviance computation for binomial when n>1, matrix response
used and an offset is present. (Thanks to Tim Miller)
......@@ -34,7 +45,7 @@ ISSUES:
smooth terms with a zero dimensional penalty null space (including
random effects). The new scheme has been tested by full replication
of the simulation study in Scheipl (2008,CSDA) to compare it to the best
method there-in. In these tests it is at least as powerful as the best
method therein. In these tests it is at least as powerful as the best
method given there, and usually indistinguishable, but it gives slightly
too low null p-values when smoothing parameters are very poorly identified.
Note that the new p-values can not be computed from old fitted gam objects.
......@@ -45,7 +56,7 @@ ISSUES:
be selected.
* "tp" smooths can now drop the null space from their construction via
a vector m argument, to allow testing against polynomial in the null space.
a vector m argument, to allow testing against polynomials in the null space.
* Fix of vicious little bug in gamm tensor product handling that could have
a te term pick up the wrong model matrix and fail.
......@@ -590,7 +601,7 @@ ISSUES:
* minor bug fix in `gamm' so that intercept gets correct name, if
it's the only non-smooth fixed effect.
* .pot files updated, de translation added.
* .pot files updated, German translation added, thanks to Detlef Steuer.
* `in.out' was not working from 1.5 --- fixed.
%- Also NEED an `\alias' for EACH other topic documented here.
\title{Prediction matrix for soap film smooth}
\description{ Creates a prediction matrix for a soap film smooth object,
mapping the coefficients of the smooth to the linear predictor component for
the smooth. This is the \code{\link{Predict.matrix}} method function required by \code{\link{gam}}.
%- maybe also `usage' for other objects documented here.
\item{object}{A class \code{""}, \code{"sf"} or \code{"sw"} object.}
\item{data}{A list list or data frame containing the arguments of the smooth
at which predictions are required.}
The smooth object will be largely what is returned from
\code{\link{}}, although elements \code{X} and
\code{S} are not needed, and need not be present, of course.
\value{ A matrix. This may have an \code{"offset"} attribute corresponding to
the contribution from any known boundary conditions on the smooth.
\author{ Simon N. Wood \email{}}
## This is a lower level example. The basis and
## penalties are obtained explicitly
## and `magic' is used as the fitting routine...
## create a boundary...
fsb <- list(fs.boundary())
## create some internal knots...
knots <- data.frame(x=rep(seq(-.5,3,by=.5),4),
## Simulate some fitting data, inside boundary...
x <- runif(n)*5-1;y<-runif(n)*2-1
z <- fs.test(x,y,b=1)
ind <- inSide(fsb,x,y) ## remove outsiders
z <- z[ind];x <- x[ind]; y <- y[ind]
n <- length(z)
z <- z + rnorm(n)*.3 ## add noise
## plot boundary with knot and data locations
## set up the basis and penalties...
sob <- smooth.construct2(s(x,y,bs="so",k=40,xt=list(bnd=fsb,nmax=100)),
## ... model matrix is element `X' of sob, penalties matrices
## are in list element `S'.
## fit using `magic'
um <- magic(z,sob$X,sp=c(-1,-1),sob$S,off=c(1,1))
beta <- um$b
## produce plots...
xm <- seq(-1,3.5,length=m);yn<-seq(-1,1,length=n)
xx <- rep(xm,n);yy<-rep(yn,rep(m,n))
## plot truth...
tru <- matrix(fs.test(xx,yy),m,n) ## truth
## Plot soap, by first predicting on a fine grid...
## First get prediction matrix...
X <- Predict.matrix2(sob,data=list(x=xx,y=yy))
## Now the predictions...
fv <- X\%*\%beta
## Plot the estimated function...
## Plot TPRS...
b <- gam(z~s(x,y,k=100))
fv.gam <- predict(b,newdata=data.frame(x=xx,y=yy))
names(sob$sd$bnd[[1]]) <- c("xx","yy","d")
ind <- inSide(sob$sd$bnd,xx,yy)
\keyword{models} \keyword{smooth} \keyword{regression}
\ No newline at end of file
%- Also NEED an `\alias' for EACH other topic documented here.
\title{FELSPLINE test function}
\description{Implements a finite area test function based on one proposed by Tim Ramsay (2002).
%- maybe also `usage' for other objects documented here.
\item{x,y}{Points at which to evaluate the test function.}
\item{r0}{The test domain is a sort of bent sausage. This is the radius of
the inner bend}
\item{r}{The radius of the curve at the centre of the sausage.}
\item{l}{The length of an arm of the sausage.}
\item{b}{The rate at which the function increases per unit increase in
distance along the centre line of the sausage.}
\item{exclude}{Should exterior points be set to \code{NA}?}
\item{n.theta}{How many points to use in a piecewise linear representation of
a quarter of a circle, when generating the boundary curve.}
The function details are not given in the source article: but this is pretty
close. The function is modified from Ramsay (2002), in that it bulges, rather
than being flat: this makes a better test of the smoother.
\value{ \code{fs.test} returns function evaluations, or \code{NA}s for points
outside the boundary. \code{fs.boundary} returns a list of \code{x,y} points
to be jointed up in order to define/draw the boundary.
Tim Ramsay (2002) "Spline smoothing over difficult regions" J.R.Statist. Soc. B 64(2):307-319
\author{ Simon N. Wood \email{}}
## plot the function, and its boundary...
fsb <- fs.boundary()
xm <- seq(-1,4,length=m);yn<-seq(-1,1,length=n)
xx <- rep(xm,n);yy<-rep(yn,rep(m,n))
tru <- matrix(fs.test(xx,yy),m,n) ## truth
\keyword{models} \keyword{smooth} \keyword{regression}%-- one or more ..
%- Also NEED an `\alias' for EACH other topic documented here.
\title{Are points inside boundary?}
Assesses whether points are inside a boundary. The boundary must enclose the
domain, but may include islands.
%- maybe also `usage' for other objects documented here.
\item{bnd}{This should have two equal length columns with names matching whatever is
supplied in \code{x} and \code{y}. This may contain several sections of boundary separated by
\code{NA}. Alternatively \code{bnd} may be a list, each element of which
contains 2 columns named as above.
See below for details.}
\item{x}{x co-ordinates of points to be tested.}
\item{y}{y co-ordinates of points to be tested.}
Segments of boundary are separated by \code{NA}s, or are in separate list elements.
The boundary co-ordinates are taken to define nodes which are joined by straight line segments in
order to create the boundary. Each segment is assumed to
define a closed loop, and the last point in a segment will be assumed to be
joined to the first. Loops must not intersect (no test is made for
The method used is to count how many times a line, in the y-direction from a
point, crosses a boundary segment. An odd number of crossings defines an
interior point. Hence in geographic applications it would be usual to have
an outer boundary loop, possibly with some inner `islands' completely
enclosed in the outer loop.
The routine calls compiled C code and operates by an exhaustive search for
each point in \code{x, y}.
\value{ The function returns a logical array of the same dimension as \code{x} and
\code{y}. \code{TRUE} indicates that the corresponding \code{x, y} point lies
inside the boundary.
\author{ Simon N. Wood \email{}}
m <- 300;n <- 150
xm <- seq(-1,4,length=m);yn<-seq(-1,1,length=n)
x <- rep(xm,n);y<-rep(yn,rep(m,n))
er <- matrix(fs.test(x,y),m,n)
bnd <- fs.boundary()
in.bnd <- inSide(bnd,x,y)
## check boundary details ...
\keyword{models} \keyword{smooth} \keyword{regression}%-- one or more ..
......@@ -75,8 +75,11 @@ For a complete list of functions type \code{library(help=mgcv)}. See also \code{
Simon Wood <>
with contributions and/or help from Thomas Kneib, Kurt Hornik, Mike Lonergan, Henric Nilsson
and Brian Ripley.
with contributions and/or help from Thomas Kneib, Kurt Hornik, Mike Lonergan, Henric Nilsson,
Fabian Scheipl and Brian Ripley.
Polish translation - Lukasz Daniel; German translation - Chris Leick, Detlef Steuer;
French Translation - Philippe Grosjean
Maintainer: Simon Wood <>
This diff is collapsed.
......@@ -64,6 +64,8 @@ for use in tensor product smooths.}
geographic units (districts of a town, for example). In this case a simple smoothing penalty is constructed
based on the neighbourhood structure of the geographic units. See \code{\link{mrf}} for details and an example.}
\item{Soap film smooths}{\code{bs="so"} (actually not single penaltied, but \code{bs="sw"} and \code{bs="sf"} allows splitting into single penalty components for use in tensor product smoothing). These are finite area smoothers designed to smooth within complicated geographical boundaries, where the boundary matters (e.g. you do not want to smooth across boundary features). See \code{\link{soap}} for details.}
Broadly speaking the default penalized thin plate regression splines tend to give the best MSE performance,
......@@ -72,20 +74,17 @@ but they are a little slower to set up than the other bases. The knot based pena
just a little worse. However the P-splines are useful in non-standard situations.
All the preceding classes (and any user defined smooths with single penalties) may be used as marginal
bases for tensor product smooths specified via \code{\link{te}} terms, except for \code{"re"} terms. Tensor
bases for tensor product smooths specified via \code{\link{te}} or \code{\link{t2}} terms. Tensor
product smooths are smooth functions
of several variables where the basis is built up from tensor products of bases for smooths of fewer (usually one)
variable(s) (marginal bases). The multiple penalties for these smooths are produced automatically from the
penalties of the marginal smooths. Wood (2006b) give the general recipe for this construction.
penalties of the marginal smooths. Wood (2006b) and Wood, Scheipl and Faraway (2012), give the general recipe for these constructions. The \code{te} construction results in fewer, more interpretable, penalties, while the \code{t2} construction is more natural if you are interested in functional ANOVA decompositions. \code{t2} works with the
\code{gamm4} package.
Tensor product smooths often perform better than isotropic smooths when the covariates of a smooth are not naturally
on the same scale, so that their relative scaling is arbitrary. For example, if smoothing with repect to time and
distance, an isotropic smoother will give very different results if the units are cm and minutes compared to if the units are
metres and seconds: a tensor product smooth will give the same
answer in both cases (see \code{\link{te}} for an example of this). Note that tensor product terms are knot based, and the
thin plate splines seem to offer no advantage over cubic or P-splines as marginal bases.
distance, an isotropic smoother will give very different results if the units are cm and minutes compared to if the units are metres and seconds: a tensor product smooth will give the same answer in both cases (see \code{\link{te}} for an example of this). Note that \code{te} terms are knot based, and the thin plate splines seem to offer no advantage over cubic or P-splines as marginal bases.
Some further specialist smoothers that are not suitable for use in tensor products are also available.
\item{Adaptive smoothers}{\code{bs="ad"}}
......@@ -103,8 +102,10 @@ class (see \code{\link{factor.smooth.interaction}}) is available for the case in
\seealso{\code{\link{s}}, \code{\link{te}}, \code{\link{tprs}}, \code{\link{cubic.regression.spline}},
\code{\link{p.spline}}, \code{\link{adaptive.smooth}}, \code{\link{user.defined.smooth}}}
\seealso{\code{\link{s}}, \code{\link{te}}, \code{\link{t2}} \code{\link{tprs}},\code{\link{Duchon.spline}},
\code{\link{cubic.regression.spline}},\code{\link{p.spline}}, \code{\link{mrf}}, code{\link{soap}},
code{\link{Spherical.Spline}}, \code{\link{adaptive.smooth}}, \code{\link{user.defined.smooth}},
code{\link{}}, code{\link{factor.smooth.interaction}}}
Simon Wood <>
......@@ -122,6 +123,9 @@ Wood, S.N. (2006a) \emph{Generalized Additive Models: an introduction with R}, C
Wood, S.N. (2006b) Low rank scale invariant tensor product smooths for
generalized additive mixed models. Biometrics 62(4):1025-1036
Wood S.N., F. Scheipl and J.J. Faraway (2012) Straightforward intermediate rank tensor product smoothing
in mixed models. Statistical Computing.
This diff is collapsed.
This diff is collapsed.
msgid ""
msgstr ""
"Project-Id-Version: mgcv 1.7-19\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-06 21:46+0100\n"
"PO-Revision-Date: 2012-08-31 17:12+0100\n"
"Last-Translator: Łukasz Daniel <>\n"
"Language-Team: Łukasz Daniel <>\n"
"Language: pl_PL\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2)\n"
"X-Poedit-SourceCharset: iso-8859-1\n"
#: gcv.c:290
#, c-format
msgid ""
"Overall smoothing parameter estimate on upper boundary.\n"
"Boundary GCV score change: %g. Largest change: %g"
msgstr ""
"Ogólne oszacowanie parametru wygładzającego na górnej granicy.\n"
"Punktacja granicy GCV zmieniła się: %g. Największa zmiana: %g"
#: gcv.c:875
msgid "resetting -ve inf"
msgstr "czyszczenie minus nieskończoności"
#: gcv.c:877
msgid "resetting +ve inf"
msgstr "czyszczenie plus nieskończoności"
#: gcv.c:1014
msgid ""
"Multiple GCV didn't improve autoinitialized relative smoothing parameters"
msgstr ""
"Wielokrotne GCV nie poprawiło automatycznie zainicjowanych względnych "
"parametrów wygładzania"
# Recommended/mgcv/src/magic.c: 406
# error(_("magic requires smoothing parameter starting values if L supplied"))
#: magic.c:507
msgid "magic requires smoothing parameter starting values if L supplied"
msgstr ""
"'magic' wymaga wartości startowych dla parametru wygładzającego jeśli L "
"zostało dostarczone"
# Recommended/mgcv/src/magic.c: 521
# error(_("magic, the gcv/ubre optimizer, failed to converge after 400 iterations."))
#: magic.c:622
msgid "magic, the gcv/ubre optimizer, failed to converge after 400 iterations."
msgstr ""
"'magic', omptymalizator gcv/ubre, nie zdodał uzbieżnić się po 400 iteracjach."
# Recommended/mgcv/src/matrix.c: 86
# (_("Failed to initialize memory for matrix."),1)
#: matrix.c:85
msgid "Failed to initialize memory for matrix."
msgstr "Nie udało się zainicjalizować pamięci dla macierzy."
# Recommended/mgcv/src/matrix.c: 148
# (_("An out of bound write to matrix has occurred!"),1)
# Recommended/mgcv/src/matrix.c: 211
# (_("An out of bound write to matrix has occurred!"),1)
#: matrix.c:147 matrix.c:210
msgid "An out of bound write to matrix has occurred!"
msgstr "Nastąpił zapis poza zakresem macierzy!"
# Recommended/mgcv/src/matrix.c: 154
# (_("INTEGRITY PROBLEM in the extant matrix list."),1)