bw(voronoi)
bw()所属R语言包:voronoi
Bandwidth for 2-d kernel estimation
2-D核估计的带宽
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Calculates a fixed bandwidth parameter for intensity estimation (with gaussian kernel) using one of two options.
计算一个固定的带宽参数估计的强度(高斯核),使用两个选项之一。
用法----------Usage----------
bw(x, method = c("pythagoras", "cross-validation"),
h=NULL, poly=NULL, extra=FALSE)
参数----------Arguments----------
参数:x
An M-by-2 matrix or data frame representing a point pattern, a deldir object, or a ve object.
M的2矩阵或数据框代表一个点模式,一个deldir对象,或ve对象。
参数:method
The default is "pythagoras", which uses Silverman's rule in each dimension separately, then computes the square root of the sum of squared bandwidths. The "cross-validation" method evaluates a set of proposed bandwidths (h).
默认是"pythagoras",它在每个维度上分开使用Silverman的规则,然后计算的平方带宽的总和的平方根。 "cross-validation"方法计算一组建议的带宽(h“)。
参数:h
A vector of bandwidths that are to be attempted using the cross-validation method.
要尝试使用的交叉验证法的带宽的向量。
参数:poly
A matrix specifying the coordinates of a polygon boundary, where the vertices are in an anti-clockwise order. This argument is used only with the cross-validation method.
一个多边形的边界,其中顶点是在反时针顺序指定的坐标的矩阵。该参数用于交叉验证的方法。
参数:extra
Output the evaluation of the bandwidths when using the cross-validation method.
输出的评价时的带宽使用的交叉验证法。
Details
详细信息----------Details----------
Under the cross-validation approach, bw tests bandwidths provided by the user. Each bandwidth is evaluated by considering the pseudo-log-likelihood (up to the addition of a constant):
在交叉验证的方法,bw测试由用户提供的带宽。每个带宽评价通过考虑伪数似然(最多到加法常数):
</i>
</ P>
值----------Value----------
A scalar bandwidth.
标量的带宽。
If extra=TRUE and the cross-validation method is being used, then a list is returned. The first item in the list is a matrix providing the bandwidths paired with their computed negative pseudo-log-likelihoods. The second item in the list is the selected bandwidth.
如果extra=TRUE和交叉验证法正在被使用,那么一个列表被返回。在列表中的第一个项目是一个矩阵提供的带宽搭配其计算负伪对数似然度。列表中的第二项选择的带宽。
(作者)----------Author(s)----------
Christopher D. Barr
参考文献----------References----------
Silverman BW. Density Estimation for Statistics and Data Analysis. London: Chapman and Hall, 1986.
参见----------See Also----------
adap.kern
adap.kern
实例----------Examples----------
par(mfrow = c(2,2))
type <- c("homogeneous", "linear", "quadratic", "moon", "ridge")[1]
#=====> Create point pattern <=====#[=>创建点模式<=====#]
gon <- cbind(c(0,1,1,0), c(0,0,1,1))
r <- 7
p <- pattern.sim(r, type = type)
plot(p, main = "points")
#=====> Create grid and plot truth <=====#[=>创建网格,图真相=====#]
n <- 75
gd <- seq(0, 1, len = n)
y <- as.matrix(expand.grid(gd, gd))
z0 <- pattern.sim(r, type = type, pts = y)[,3]
m0 <- matrix(z0, n, n)
grsc <- grey(seq(1, 0, len = 1500))
image(m0, col = grsc, axes = FALSE, main = "truth")
box()
#=====> BW using Silverman's rule <=====#[=====> BW Silverman的规则=====#]
sBW <- bw(p)
z1 <- lambdahat(p, sBW, y, gon)$lambda
m1 <- matrix(z1, n, n)
image(m1, col = grsc, axes = FALSE, main = "Silverman's bandwidth")
box()
mtext(round(sBW, 4), 3)
#=====> BW using cross-validation <=====#[=====> BW使用交叉验证=====#]
h <- seq(sBW/10, 3*sBW, sBW/10)
cvBW <- bw(p, 'c', h, gon)
z2 <- lambdahat(p, cvBW, y, gon)$lambda
m2 <- matrix(z2, n, n)
image(m2, col = grsc, axes = FALSE, main = "cross-validation bandwidth")
box()
mtext(round(cvBW, 4), 3)
#=====> Detailed output for c-v case <=====#[=>详细的输出为C-V的情况下=====#]
cvBW.extra <- bw(p, 'c', h, gon, TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|