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

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

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

                                        Markov Random Field Smooths
                                         马尔可夫随机场平滑

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

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

For data observed over discrete spatial units, a simple Markov random field  smoother is sometimes appropriate. These functions provide such a smoother class for mgcv.
对于离散空间单位,观测数据,一个简单的马尔可夫随机场顺畅有时是适当的。这些功能提供了这种顺畅类mgcv。


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


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



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

参数:object
For the smooth.construct method a smooth specification object,  usually generated by a term s(x,...,bs="mrf",xt=list(polys=foo)). x is a factor variable giving labels  for geographic districts, and the xt argument  is obligatory: see details. For the Predict.Matrix method  an object of class "mrf.smooth" produced by the smooth.construct method.
顺利的规范对象为smooth.construct方法,通常由一个术语s(x,...,bs="mrf",xt=list(polys=foo))。 x是一个因素变量给地理区的标签,和xt参数是强制性的:看到细节。类对象为Predict.Matrix方法"mrf.smooth"生产smooth.construct方法。


参数: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
If there are more geographic areas than data were observed for, then this argument is used to  provide the labels for all the areas (observed and unobserved).  
如果有更多的地理区域比数据观察,那么这个参数是用来提供标签的所有领域(观测和不可观测)。


Details

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

A Markov random field smooth over a set of discrete areas is defined using a set of area labels, and  a neighbourhood structure for the areas. The covariate of the smooth is the vector of area labels  corresponding to each obervation. This covariate should be a factor, or capable of being coerced to a factor.
马尔可夫随机场顺利超过一套离散区域是指使用一套面积标签,一个区域的邻里结构。协的顺利是每个obervation相应面积标签的向量。该协变量应该是一个因素,或者能够被裹挟到一个因素。

The neighbourhood structure is supplied in the xt argument to s. This must contain at least one of  the elements polys, nb or penalty.
邻里结构提供xts参数。这必须包含至少一个元素polys,nb或penalty。




polys contains the polygons defining the geographic areas.  It is a list with as many elements as there are geographic areas.  names(polys) must correspond to the levels of the argument of the smooth, in any order (i.e. it gives the area labels).  polys[[i]] is a 2 column matrix the rows of which specify the vertices of the polygon(s)  defining the boundary of the ith area. A boundary may be made up of several closed loops: these must be separated by NA rows. A polygon within another is treated as a hole. The first polygon in  any polys[[i]]  should not be a hole.  An example  of the structure is provided by columb.polys (which contains an artificial hole in its second element, for illustration). Any list elements with duplicate names are combined into a  single NA separated matrix.
多边形包含的多边形定义的地理区域。这是一个与尽可能多的元素的列表,有地域。 names(polys)必须符合水平顺利参数,在任何顺序(即它使该区域的标签)。 polys[[i]]是一个2列的矩阵行指定多边形的定义第i个区域的边界(S)的顶点。边界可以由几个闭环:这些必须由NA行分隔。在另一个多边形被视为一个洞。在任何polys[[i]]第一多边形不应该是一个洞。结构的一个例子是columb.polys(其中包含画像,在其第二个元素的人工挖孔)。任何重复的名称列表中的元素组合成一个单一的无分离矩阵。

Plotting of the smooth is not possible without a polys object.
绘制的顺利是不可能的没有polys对象。

If polys is the only element of xt provided, then the neighbourhood structure is  computed from it automatically. To count as neigbours, polygons must exactly share one of more  vertices.
polys如果xt提供的,那么邻里结构从它自动计算的唯一元素。计数作为neigbours,多边形必须完全共享更多的顶点之一。




nb is a named list defining the neighbourhood structure. names(nb) must correspond to the  levels of the covariate of the smooth (i.e. the area labels), but can be in any order. nb[[i]]  is a vector indexing the neighbours of the ith area. All indices are relative to nb itself, but  can be translated using names(nb).
NB是一个名为列表定义的邻域结构。 names(nb)必须对应顺利(即标签的面积)协的水平,但可以是任何顺序。 nb[[i]]是一个向量索引的第i个区域的邻国。所有指数nb本身是相对的,但可以使用names(nb)翻译。

If no 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  of neighbours of the ith geographic area, and the columns corresponding to those geographic  neighbours, which will each contain -1.  
如果没有penalty提供,那么它自动计算从这个名单。将罚款矩阵的第i行零everwhere,除了在第i列,其中将包含第i个地理区域的邻居和列的数量,相应的这些地理上的邻居,将每个包含-1。




penalty  if this is supplied, then it is used as the penalty matrix. It should be positive semi-definite.
如果提供的刑罚,然后它被用作刑罚矩阵。它应该是半正定。

If no basis dimension is supplied then the constructor produces a full rank MRF, with a coefficient for each  geographic area. Otherwise a low rank approximation is obtained based on truncation of the parameterization given in Wood (2006) Section 4.10.4.
如果没有基础的维度提供的构造函数产生一个完整的排名中期预测,每个地理区域系数。否则得到低阶近似的基础上截断木(2006)第4.10.4给出的参数。

Note that smooths of this class have a built in plot method, and that the utility function in.out  can be useful for working with discrete area data. The plot method has two schemes, scheme==0 is colour,  scheme==1 is grey scale.
注意,这个类的平滑有内置图法,效用函数in.out可以工作与离散面积数据是有用的。图的方法有两种方案,scheme==0是颜色,scheme==1是灰色的规模。


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

An object of class "mrf.smooth" or a matrix mapping the coefficients of the MRF smooth  to the predictions for the areas listed in data.
一个类的对象"mrf.smooth"或映射顺利为data所列领域的预测,中期预测的系数矩阵。


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


Simon N. Wood <a href="mailto:simon.wood@r-project.org">simon.wood@r-project.org</a> and Thomas Kneib
(Fabian Scheipl prorotyped the low rank MRF idea)



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



参见----------See Also----------

in.out, polys.plot
in.out,polys.plot


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


library(mgcv)
## Load Columbus Ohio crime data (see ?columbus for details and credits)[#负载俄亥俄州哥伦布市的犯罪数据(见?哥伦布的细节和学分)]
data(columb)       ## data frame[#数据框]
data(columb.polys) ## district shapes list[#区的形状列表]
xt &lt;- list(polys=columb.polys) ## neighbourhood structure info for MRF[#邻里磁流变结构信息]
par(mfrow=c(2,2))
## First a full rank MRF...[#第一个完整的排名中期预测...]
b <- gam(crime ~ s(district,bs="mrf",xt=xt),data=columb,method="REML")
plot(b,scheme=1)
## Compare to reduced rank version...[#比较,以降低排名的版本...]
b <- gam(crime ~ s(district,bs="mrf",k=20,xt=xt),data=columb,method="REML")
plot(b,scheme=1)
## An important covariate added...[#一个重要的协变量添加...]
b <- gam(crime ~ s(district,bs="mrf",k=20,xt=xt)+s(income),
         data=columb,method="REML")
plot(b,scheme=c(0,1))

## plot fitted values by district[#按区域绘制的拟合值]
par(mfrow=c(1,1))
fv <- fitted(b)
names(fv) <- as.character(columb$district)
polys.plot(columb.polys,fv)


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-24 02:18 , Processed in 0.032391 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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