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

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

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

                                        Low rank Duchon 1977 splines
                                         低排名Duchon 1977样条

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

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

Thin plate spline smoothers are a special case of the isotropic splines discussed in Duchon (1977). A subset of this more  general class can be invoked by terms like s(x,z,bs="ds",m=c(1,.5) in a gam model formula. In the notation of Duchon (1977) m is given by m[1] (default value 2), while s is given by m[2] (default value 0).
薄板样条平滑是各向同性在Duchon(1977)讨论了样条的特殊情况。这个更一般的类的一个子集,可以调用类似条款s(x,z,bs="ds",m=c(1,.5)gam模型公式。在符号Duchon(1977)m是由m[1](默认值),而S是由m[2](默认值0)。

Duchon's (1977) construction generalizes the usual thin plate spline penalty as follows. The usual TPS penalty is given by the integral  of the squared Euclidian norm of a vector of mixed partial derivatives of the function w.r.t. its arguments. Duchon re-expresses  this penalty in the Fourier domain, and then weights the squared norm in the integral by the Euclidean norm of the fourier frequencies,  raised to the power 2s. s is a user selected constant taking integer values divided by 2. If d is the numberof arguments of the smooth,  then it is required that -d/2 < s < d/2. To obtain continuous functions we further require that m + s > d/2. If s=0 then the usual thin plate  spline is recovered.
duchon(1977年)的建设,推广平常的薄板样条处罚如下。刑罚通常租者置其屋计划的一个向量的功能相对于混合偏导数的平方欧几里德范数的积分它的参数。 duchon重新表示在傅立叶域这个点球,然后重积分傅立叶频率,提高功率2欧几里德范数平方规范。是不断采取整数值除以2选择一个用户。如果d是顺利numberof参数,那么它需要-D / 2 <S <D / 2。要获得持续的功能,我们进一步要求M + S> D / 2。如果S = 0,则通常薄板样条恢复。

The construction is amenable to exactly the low rank approximation method given in Wood (2003) to thin plate splines, with similar  optimality properties, so this approach to low rank smoothing is used here. For large datasets the same subsampling approach as is used in the  tprs case is employed here to reduce computational costs.
施工完全低阶近似方法木(2003)薄板样条类似的最优性能,是适合的,所以这种低排名平滑的方法是用在这里。对于大型数据集使用相同的抽样方法,在tprs情况这里,以减少计算成本。

These smoothers allow the use of lower orders of derivative in the penalty than conventional thin plate splines,  while still yielding continuous functions.
这些平滑允许较低的衍生订单罚款比使用传统的薄板样条,同时还产生连续函数。


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


## S3 method for class 'ds.smooth.spec'
smooth.construct(object, data, knots)
## S3 method for class 'duchon.spline'
Predict.matrix(object, data)



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

参数:object
a smooth specification object, usually generated by a term s(...,bs="ds",...).
顺利的规范对象,通常任期s(...,bs="ds",...)。


参数: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 &mdash; in same order and with same names as data.  Can be NULL
一个列表,其中包含基础设置提供任何节 - 在同一顺序相同的名称为data。可以NULL


Details

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

The default basis dimension for this class is k=M+k.def where M is the null space dimension  (dimension of unpenalized function space) and k.def is 10 for dimension 1, 30 for dimension 2 and 100 for higher dimensions.  This is essentially arbitrary, and should be checked, but as with all penalized regression smoothers, results are statistically  insensitive to the exact choise, provided it is not so small that it forces oversmoothing (the smoother's  degrees of freedom are controlled primarily by its smoothing parameter).
这个类的默认基础尺寸是k=M+k.defM是空的空间尺寸(的unpenalized函数空间的维数)k.def尺寸1 10 30 2维和100更高的层面。这基本上是任意,应进行检查,但作为与所有受罚回归平滑,结果是统计不敏感的准确体例选择,它是不那么小,它迫使oversmoothing(自由,流畅的程度是主要是由它的平滑参数控制)。

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。

For these classes the specification object will contain information on how to handle large datasets in their xt field. The default is to randomly subsample 2000 "knots" from which to produce a reduced rank eigen approximation to the full basis,  if the number of unique predictor variable combinations in excess of 2000. The default can be modified via the xt argument to s. This is supplied as a list with elements max.knots and seed containing a number to use in place of 2000, and the random number seed to use (either can be missing). Note that the random sampling will not effect the state of R's RNG.
这些类的规范object将包含如何处理大型数据集,在他们的xt场的信息。默认的是随机子样本2000“节”,从它产生一个降秩特征近似完整的基础上,如果数量超过2000年的独特预测变量组合。默认情况下,可以通过xts参数进行修改。这是作为一个元素的列表提供max.knots和seed包含一个数字,在2000年的地方使用,并使用随机数种子(或者可以被失踪)。需要注意的是随机抽样不会影响R的RNG的状态。

For these bases knots has two uses. Firstly, as mentioned already, for large datasets  the calculation of the tp basis can be time-consuming. The user can retain most of the advantages of the  approach by supplying  a reduced set of covariate values from which to obtain the basis -  typically the number of covariate values used will be substantially  smaller than the number of data, and substantially larger than the basis dimension, k. This approach is  the one taken automatically if the number of unique covariate values (combinations) exceeds max.knots. The second possibility is to avoid the eigen-decomposition used to find the spline basis altogether and simply use  the basis implied by the chosen knots: this will happen if the number of knots supplied matches the  basis dimension, k. For a given basis dimension the second option is  faster, but gives poorer results (and the user must be quite careful in choosing knot locations).
这些基地knots有两个用途。首先,正如已经提到的,tp的基础,可以费时的计算大型数据集。用户可以保留大部分供应减少了协值的集合,从中获取的基础上,该方法的优点 - 通常使用的协变量值将大大小于数据的数量,并大大高于基础层面更大k。这种方法是一个自动采取独特的协变量值(组合),如果超过max.knots。第二个可能性是为了避免使用样条线的基础上,共找到,只需使用所选择的结暗示的基础特征分解:会出现这种情况,如果提供海里的数量相匹配的基础层面,k。对于一个给定的基础维度的第二个选项是更快,但给出的结果较差(用户必须相当谨慎选择结位置)。


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

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


参数:shift
A record of the shift applied to each covariate in order to center it around zero and  avoid any co-linearity problems that might otehrwise occur in the penalty null space basis of the term.  
移位的记录应用于每个协以围绕零,避免任何可能otehrwise发生在点球空一词的空间基础的共线性问题。


参数:Xu
A matrix of the unique covariate combinations for this smooth (the basis is constructed by first stripping  out duplicate locations).
独特协组合矩阵,这个平稳(构造的基础是先剥离出重复的位置)。


参数:UZ
The matrix mapping the smoother parameters back to the parameters of a full Duchon spline.
矩阵平滑参数映射回一个完整的Duchon样条的参数。


参数:null.space.dimension
The dimension of the space of functions that have zero wiggliness according to the  wiggliness penalty for this term.
维空间的功能,有零wiggliness根据本学期wiggliness罚款。


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


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



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

Construction theory of functions of several variables, 85-100, Springer, Berlin.


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


eg <- gamSim(2,n=200,scale=.05)
attach(eg)
op <- par(mfrow=c(2,2),mar=c(4,4,1,1))
b0 &lt;- gam(y~s(x,z,bs="ds",m=c(2,0),k=50),data=data)  ## tps[#租者置其屋计划]
b &lt;- gam(y~s(x,z,bs="ds",m=c(1,.5),k=50),data=data)  ## first deriv penalty[#第一DERIV罚款]
b1 &lt;- gam(y~s(x,z,bs="ds",m=c(2,.5),k=50),data=data) ## modified 2nd deriv[#修改第二DERIV]

persp(truth$x,truth$z,truth$f,theta=30) ## truth[#真相]
vis.gam(b0,theta=30)
vis.gam(b,theta=30)
vis.gam(b1,theta=30)

detach(eg)


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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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