NS(sparr)
NS()所属R语言包:sparr
Normal scale rule for bivariate KDE bandwidths
二元KDE带宽的正常范围规则
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Provides the (isotropic) optimal bandwidth for a bivariate normal density based on a simple expression.
(各向同性)提供最优的带宽为的一个二元正常密度,基于一个简单的表达。
用法----------Usage----------
NS(data, nstar = NULL, scaler = NA)
参数----------Arguments----------
参数:data
An object of type data.frame, list, matrix, or ppp giving the observed data from which we wish to calculate the NS bandwidth. See "Details" for further information.
类型的对象,data.frame,list,matrix或ppp给所观察到的数据,从中我们希望计算NS带宽。的详细信息,请参阅“详细信息”。
参数:nstar
A single numeric, positive value to use in place of the number of observations n in the NS formula. If NULL (default), n will simply be the number of observations in data.
一个单一的数字,正面使用的若干意见NS公式中的n值。如果NULL(默认),n将仅仅是在data的若干意见。
参数:scaler
A single numeric, positive value to use for transforming the result with respect to the scale of the recorded data (i.e. a scalar representation of the standard deviation of the data). If NA (default), the scaling value is set as the mean of the interquartile ranges (IQR) of the x and y data values divided by 1.34 (Gaussian IQR).
一个单一的数字,用于转化的结果相对于所记录的数据的规模(即标量数据的标准偏差表示)的正值。如果NA(默认值),标定值被设置的四分位范围内的平均值(IQR)的x和y的数据值除以1.34(高斯IQR)。
Details
详细信息----------Details----------
This function calculates a smoothing bandwidth for kernel density estimates of 2-dimensional data: the optimal value which would minimise the asymptotic mean integrated squared error of the bivariate normal density function, assuming the standard Gaussian kernel function. See Wand and Jones (1995) for example. If the data argument is a data.frame or a matrix, this must have exactly two columns containing the x ([,1]) and y ([,2]) data values. Should data be a list, this must have two vector components of equal length named x and y. Alternatively, data may be an object of class ppp (see ppp.object).
此函数计算平滑的二维数据带宽,内核密度估计的最优值减少,假定使用标准的高斯核函数的渐近意味着二元正态密度函数的积分平方误差。魔杖和琼斯(1995)。如果data参数是一个data.frame或matrix,这必须有两列包含x([,1])和y([,2])的数据值。 data是list,这必须有两个长度相等的名为x和y矢量分量。另外,data可能是类的一个对象ppp(见ppp.object)。
值----------Value----------
A single numeric value of the estimated bandwidth.
一个数值的估计带宽。
警告----------Warning----------
The NS bandwidth is an approximation, and assumes that the target density is bivariate normal. This is considered rare in e.g. epidemiological applications. Nevertheless, it remains a quick and easy "rule-of-thumb" method with which one may obtain a smoothing parameter in general applications.
的NS带宽是一个近似值,并假定目标密度是二元正态分布。这被认为是罕见的例如流行病学应用。尽管如此,它仍然是一个快速和简单的规则的拇指用哪一个方法可以得到一个平滑参数,在一般应用。
(作者)----------Author(s)----------
T.M. Davies
参考文献----------References----------
实例----------Examples----------
data(PBC)
PBC.casedata <- split(PBC)[[1]]
PBC.controldata <- split(PBC)[[2]]
pbc.h <- NS(PBC, nstar = sqrt(PBC.casedata$n * PBC.controldata$n))
##Scaling bandwidth for case data using standard deviations[#缩放的带宽使用标准偏差的情况下,数据]
sd.x <- sd(PBC.casedata$x)
sd.y <- sd(PBC.casedata$y)
NS(data = PBC.casedata, scaler = mean(sd.x, sd.y))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|