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

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

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

                                        Splines on the sphere
                                         球体上的样条

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

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

gam can use isotropic smooths on the sphere, via terms like  s(la,lo,bs="sos",m=2,k=100). There must be exactly 2 arguments to such a smooth.  The first is taken to be latitude (in degrees) and the second longitude (in degrees).  m (default 0) is an integer in the range -1 to 4 determining the order of the penalty used.  For m>0, (m+2)/2 is the penalty order, with m=2 equivalent to the usual second  derivative penalty. m=0 signals to use the 2nd order spline on the sphere, computed by  Wendelberger's (1981) method. m = -1 results in a Duchon.spline being  used (with m=2 and s=1/2), following an unpublished suggestion of Jean Duchon.
gam可以使用各向同性平滑球体,通过像s(la,lo,bs="sos",m=2,k=100)。必须是完全2个参数,这样顺利。首先是纬度(度)和第二个经度(度)。 m(默认为0)是一个整数范围在-1至4确定使用罚款的顺序。 m>0,(m+2)/2是m=2相当于通常的二阶导数罚款,罚令。 m=0信号用的球体上的二阶样条曲线,Wendelberger(1981)的方法计算。 m = -1导致一个Duchon.spline(M = 2和S = 1/2),后让Duchon的未发表的建议“。

k (default 50) is the basis dimension.
k(默认为50)的基础层面。


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


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



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

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


参数: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
一个列表,其中包含基础设置提供任何节 - 在同一顺序相同的名称为data。可以NULL


Details

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

For m>0, the smooths implemented here are based on the pseudosplines on the sphere of Wahba (1981)  (there is a correction of table 1 in 1982, but the correction has a misprint in the definition of A — the A given in the 1981 paper is correct). For m=0 (default) then a second order spline on the sphere is used which is the  analogue of a second order thin plate spline in 2D: the computation is based on Chapter 4 of Wendelberger, 1981.  Optimal low rank approximations are obtained using exactly the approach given in Wood (2003). For m = -1 a smooth of the  general type discussed in Duchon (1977) is used: the sphere is embedded in a 3D Euclidean space, but  smoothing employs a penalty based on second derivatives (so that locally as the smoothing parameter tends  to zero we recover a "normal" thin plate spline on the tangent space). This is an unpublished suggestion of Jean Duchon.
m>0,平滑实施Wahba球(1981)(表1是在1982年的修正,但修正有一个定义的错字pseudosplines  - 一个在1981年的一篇论文中给出的是正确的)。 m=0(默认),然后球体上的二阶样条使用,这是在二维二阶薄板样条模拟计算的基础上,1981年章4的Wendelberger的。完全使用木材(2003)中给出的方法,得到最佳的低排名近似。 m = -1的在Duchon(1977)讨论了一般类型的顺利使用:球体被嵌入在三维欧几里得空间,但平滑采用基于二阶导数的罚款(使本地的平滑参数往往为零,我们收回切空间上的一个“正常”薄板样条)。这是未发表让Duchon的建议。

Note that the null space of the penalty is always the space of constant functions on the sphere, whatever the order of penalty.
注意,的罚款空空间始终是常数函数空间的球体上,无论为了罚款。

This class has a plot method, with 3 schemes. scheme==0 plots one hemisphere of the sphere, projected onto a circle. The plotting sphere has the north pole at the top, and the 0 meridian running down the middle of the plot, and towards  the viewer. The smoothing sphere is rotated within the plotting sphere, by specifying the location of its pole in the  co-ordinates of the viewing sphere. theta, phi give the longitude and latitude of the smoothing sphere pole within the plotting sphere (in plotting sphere co-ordinates). (You can visualize the smoothing sphere as a globe, free to  rotate within the fixed transparent plotting sphere.) The value of the smooth is shown by a heat map overlaid with a  contour plot. lat, lon gridlines are also plotted.
这个类有一个图的方法,3个方案。 scheme==0绘制一个球体的半球,投射到一个圆圈。绘图领域拥有北极在顶部,0经络运行中间的图,向观众。平滑领域内图球的旋转,在观看球的坐标位置,指定其极。 theta,phi在绘图领域(在图领域统筹)的平滑球体极点的经度和纬度。 (你可以想像作为一个全球的平滑球体,固定透明绘图领域内自由旋转。)顺利价值与等高线图叠加热图所示。纬度,经度网格线也绘制。

scheme==1 is as scheme==0, but in black and white, without the image plot. scheme>1 calls the default  plotting method with scheme decremented by 2.
scheme==1scheme==0,但在黑色和白色,无影像图。 scheme>1scheme递减2调用默认的绘制方法。


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

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


参数: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 parameters of the reduced rank spline back to the parameters of a full spline.
矩阵降秩样条的参数映射回一个完整的样条的参数。


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


Simon Wood <a href="mailto:simon.wood@r-project.org">simon.wood@r-project.org</a>,
with help from Grace Wahba (m=0 case) and Jean Duchon (m = -1 case).



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






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


set.seed(0)
n <- 400

f &lt;- function(la,lo) { ## a test function...[#测试功能...]
  sin(lo)*cos(la-.3)
}

## generate with uniform density on sphere...  [#生成球密度均匀...]
lo &lt;- runif(n)*2*pi-pi ## longitude[#经度]
la <- runif(3*n)*pi-pi/2
ind <- runif(3*n)<=cos(la)
la <- la[ind];
la <- la[1:n]

ff <- f(la,lo)
y &lt;- ff + rnorm(n)*.2 ## test data[#测试数据]

## generate data for plotting truth...[#生成数据绘制真理...]
lam <- seq(-pi/2,pi/2,length=30)
lom <- seq(-pi,pi,length=60)
gr <- expand.grid(la=lam,lo=lom)
fz <- f(gr$la,gr$lo)
zm <- matrix(fz,30,60)

require(mgcv)
dat <- data.frame(la = la *180/pi,lo = lo *180/pi,y=y)

## fit spline on sphere model...[#适合对领域模型的样条...]
bp <- gam(y~s(la,lo,bs="sos",k=60),data=dat)

## pure knot based alternative...[#纯结的替代...]
ind <- sample(1:n,100)
bk <- gam(y~s(la,lo,bs="sos",k=60),knots=list(la=dat$la[ind],lo=dat$lo[ind]),data=dat)

b <- bp

cor(fitted(b),ff)

## plot results and truth...[#图的结果和真相...]

pd <- data.frame(la=gr$la*180/pi,lo=gr$lo*180/pi)
fv <- matrix(predict(b,pd),30,60)

par(mfrow=c(2,2),mar=c(4,4,1,1))
contour(lom,lam,t(zm))
contour(lom,lam,t(fv))
plot(bp,rug=FALSE)
plot(bp,scheme=1,theta=-30,phi=20,pch=19,cex=.5)


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 22:37 , Processed in 0.020398 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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