找回密码
 注册
查看: 2490|回复: 0

R语言:smooth.construct.cr.smooth.spec()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 18:30:29 | 显示全部楼层 |阅读模式
smooth.construct.cr.smooth.spec(mgcv)
smooth.construct.cr.smooth.spec()所属R语言包:mgcv

                                        Penalized Cubic regression splines in GAMs
                                         在GAMS处罚三次回归样条

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

gam can use univariate penalized cubic regression spline smooths, specified via terms like s(x,bs="cr"). s(x,bs="cs") specifies a penalized cubic regression spline which has had its penalty modified  to shrink towards zero at high enough smoothing parameters (as the smoothing parameter goes to infinity a normal cubic spline tends to a  straight line.) s(x,bs="cc") specifies a cyclic penalized cubic regression spline smooth.
gam可以使用单因素处罚立方米回归样条平滑,通过像s(x,bs="cr")指定。 s(x,bs="cs")指定处罚三次回归样条,其中有其刑罚的修改,以实现零收缩在足够高的平滑参数(平滑参数趋于无穷正常的三次样条趋于一条直线。)s(x,bs="cc")指定处罚三次回归样条平滑循环。

"Cardinal" spline bases are used: Wood (2006) sections 4.1.2 and 4.1.3 gives full details. These bases have  very low setup costs. For a given basis dimension, k, they typically perform a little less well  then thin plate regression splines, but a little better than p-splines. See te to use these bases in tensor product smooths of several variables.
样条红衣主教基地:木(2006)第4.1.2和4.1.3充分的细节。这些基地安装成本非常低。对于一个给定的基础上维k,他们通常执行那么少薄板回归样条,但有一点比P-样条更好。看到te使用这些基地中的张量积平滑的几个变量。


用法----------Usage----------


## S3 method for class 'cr.smooth.spec'
smooth.construct(object, data, knots)
## S3 method for class 'cs.smooth.spec'
smooth.construct(object, data, knots)
## S3 method for class 'cc.smooth.spec'
smooth.construct(object, data, knots)



参数----------Arguments----------

参数:object
a smooth specification object, usually generated by a term s(...,bs="cr",...), s(...,bs="cs",...) or s(...,bs="cc",...)
平稳规范的对象,通常会产生一个长期s(...,bs="cr",...),s(...,bs="cs",...)或s(...,bs="cc",...)


参数:data
a list containing just the data (including any by variable) required by this term,  with names corresponding to object$term (and object$by). The by variable  is the last element.  
一个列表,其中包含的数据(包括任何by变)这个词所要求的名称object$term,(object$by)。 by变量是最后一个元素。


参数:knots
a list containing any knots supplied for basis setup — in same order and with same names as data.  Can be NULL. See details.
一个列表,其中包含基础设置提供任何节 - 在同一顺序相同的名称为data。可以NULL。查看详情。


Details

详情----------Details----------

The constructor is not normally called directly, but is rather used internally by gam.  To use for basis setup it is recommended to use smooth.construct2.  
构造函数通常不直接调用,但内部而不是使用gam。用于基础设置,建议使用smooth.construct2。

If they are not supplied then the knots  of the spline are placed evenly throughout the covariate values to which the term refers:  For example, if fitting 101 data with an 11 knot spline of x then there would be a knot at every 10th (ordered)  x value. The parameterization used represents the spline in terms of its values at the knots. The values at neighbouring knots are connected by sections of  cubic polynomial constrained to be  continuous up to and including second derivative at the knots. The resulting curve is a natural cubic  spline through the values at the knots (given two extra conditions specifying  that the second derivative of the curve should be zero at the two end  knots).
如果他们不提供样条节放在整个均匀协价值观一词是指:例如,如果装修101数据与11个结点样条x然后在每一个会有结第十届(有序)x的值。使用参数化表示其值的样条在海里。在邻近节的值约束是连续起来,包括在海里的第二衍生三次多项式的部分连接。由此产生的曲线通过在海里(指定曲线的二阶导数应该在两个端结零的额外条件)的值是一个自然的三次样条。

The shrinkage version of the smooth, eigen-decomposes the wiggliness penalty matrix, and sets its 2 zero eigenvalues to small  multiples of the smallest strictly positive eigenvalue. The penalty is then set to the matrix with eigenvectors corresponding  to those of the original penalty, but eigenvalues set to the peturbed versions. This penalty matrix has full rank and shrinks  the curve to zero at high enough smoothing parameters.
收缩版本的顺利,本征分解的wiggliness的罚款矩阵,并设置其严格正的最小特征值的小倍数的零特征值。刑罚设置与原处罚的相应特征向量矩阵,特征值设置的peturbed版本。这个点球矩阵满秩和收缩曲线在足够高的平滑参数为零。

Note that the cyclic smoother will wrap at the smallest and largest covariate values, unless knots are supplied. If only two  knots are supplied then they are taken as the end points of the smoother (provided all the data lie between them), and the  remaining knots are generated automatically.
请注意,循环顺畅,将包裹在最小和最大的协值,除非节提供。如果只有两节,然后提供他们采取平滑终点(前提在于它们之间的所有数据),其余节是自动生成的。

The cyclic smooth is not  subject to the condition that second derivatives go to zero at the first and last knots.
循环平稳是不接受的条件,第二衍生物去为零的第一个和最后一个节。


值----------Value----------

An object of class "cr.smooth" "cs.smooth" or "cyclic.smooth". In addition to the usual elements of a smooth class documented under smooth.construct,  this object will contain:
一个类的对象"cr.smooth""cs.smooth"或"cyclic.smooth"。除了平时记录下smooth.construct顺利类元素,这个对象将包含:


参数:xp
giving the knot locations used to generate the basis.
给结位置,用于生成的基础。


参数:BD
class "cyclic.smooth" objects include matrix BD which transforms function values  at the knots to second derivatives at the knots.
类"cyclic.smooth"对象包括矩阵BD转换疙瘩在海里的二阶导数函数值。


作者(S)----------Author(s)----------


Simon N. Wood <a href="mailto:simon.wood@r-project.org">simon.wood@r-project.org</a>



参考文献----------References----------

and Hall/CRC Press.

举例----------Examples----------


## cyclic spline example...[#循环样条的例子...]
  set.seed(6)
  x <- sort(runif(200)*10)
  z <- runif(200)
  f <- sin(x*2*pi/10)+.5
  y <- rpois(exp(f),exp(f))

## finished simulating data, now fit model...[#完成模拟数据,现在合适的模型...]
  b <- gam(y ~ s(x,bs="cc",k=12) + s(z),family=poisson,
                      knots=list(x=seq(0,10,length=12)))
## or more simply[#或更简单]
   b <- gam(y ~ s(x,bs="cc",k=12) + s(z),family=poisson,
                      knots=list(x=c(0,10)))

## plot results...[#图的结果......]
  par(mfrow=c(2,2))
  plot(x,y);plot(b,select=1,shade=TRUE);lines(x,f-mean(f),col=2)
  plot(b,select=2,shade=TRUE);plot(fitted(b),residuals(b))
  


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-23 15:08 , Processed in 0.049109 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表