exclude.too.far(mgcv)
exclude.too.far()所属R语言包:mgcv
Exclude prediction grid points too far from data
排除预测网格点太远数据
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Takes two arrays defining the nodes of a grid over a 2D covariate space and two arrays defining the location of data in that space, and returns a logical vector with elements TRUE if the corresponding node is too far from data and FALSE otherwise. Basically a service routine for vis.gam and plot.gam.
需要两个数组,一个网格的节点定义了二维协的空间和两个数组的定义,空间数据的位置,并返回一个逻辑向量的元素TRUE如果相应的节点太远,从数据和FALSE否则。基本上是一个服务程序vis.gam和plot.gam。
用法----------Usage----------
exclude.too.far(g1,g2,d1,d2,dist)
参数----------Arguments----------
参数:g1
co-ordinates of grid relative to first axis.
电网相对第一轴的坐标。
参数:g2
co-ordinates of grid relative to second axis.
电网相对第二轴的坐标。
参数:d1
co-ordinates of data relative to first axis.
统筹相对第一轴的数据。
参数:d2
co-ordinates of data relative to second axis.
第二轴的数据相统筹。
参数:dist
how far away counts as too far. Grid and data are first scaled so that the grid lies exactly in the unit square, and dist is a distance within this unit square.
如何远离计数作为太远。网格和数据第一缩放,正好在单位正方形网格在于,dist是本单位正方形内的距离。
Details
详情----------Details----------
Linear scalings of the axes are first determined so that the grid defined by the nodes in g1 and g2 lies exactly in the unit square (i.e. on [0,1] by [0,1]). These scalings are applied to g1, g2, d1 and d2. The minimum Euclidean distance from each node to a datum is then determined and if it is greater than dist the corresponding entry in the returned array is set to TRUE (otherwise to FALSE). The distance calculations are performed in compiled code for speed without storage overheads.
首先确定轴的线性结垢从而使电网由g1和g2在于完全(即在单位正方形[0,1] [0,1])的节点定义。这些结垢g1,g2,d1和d2。从每个节点到基准的最小欧氏距离,然后确定,如果它大于dist返回数组中的相应项设置为TRUE(否则FALSE)。距离计算的速度没有在编译的代码存储开销。
值----------Value----------
A logical array with TRUE indicating a node in the grid defined by g1, g2 that is "too far" from any datum.
与TRUE表示定义的网格节点的逻辑阵列g1,g2,是太远从任何基准。
作者(S)----------Author(s)----------
Simon N. Wood <a href="mailto:simon.wood@r-project.org">simon.wood@r-project.org</a>
参考文献----------References----------
参见----------See Also----------
vis.gam
vis.gam
举例----------Examples----------
library(mgcv)
x<-rnorm(100);y<-rnorm(100) # some "data"[一些“数据”]
n<-40 # generate a grid....[生成一个网格......]
mx<-seq(min(x),max(x),length=n)
my<-seq(min(y),max(y),length=n)
gx<-rep(mx,n);gy<-rep(my,rep(n,n))
tf<-exclude.too.far(gx,gy,x,y,0.1)
plot(gx[!tf],gy[!tf],pch=".");points(x,y,col=2)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|