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

R语言:tilt.boot()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 19:44:05 | 显示全部楼层 |阅读模式
tilt.boot(boot)
tilt.boot()所属R语言包:boot

                                         Non-parametric Tilted Bootstrap
                                         非参数倾斜引导

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

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

This function will run an initial bootstrap with equal resampling  probabilities (if required) and will use the output of the initial run to  find resampling probabilities which put the value of the statistic at required values.  It then runs an importance resampling bootstrap using the calculated probabilities as the resampling distribution.
此功能将运行最初的引导和重采样的概率相等(如需要)将使用初始运行的输出,以找到所需的值重采样概率统计值。然后,它运行的重要性重采样引导使用重采样分布计算概率。


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


tilt.boot(data, statistic, R, sim = "ordinary", stype = "i",
          strata = rep(1, n), L = NULL, theta = NULL,
          alpha = c(0.025, 0.975), tilt = TRUE, width = 0.5,
          index = 1, ...)



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

参数:data
The data as a vector, matrix or data frame.  If it is a matrix or data frame then each row is considered as one (multivariate) observation.  
作为一个向量,矩阵或数据框中的数据。如果它是一个矩阵或数据框,那么每一行被视为一(多元)观察。


参数:statistic
A function which when applied to data returns a vector containing the statistic(s) of interest.  It must take at least two arguments.  The first argument will always be data and the second should be a vector of indices, weights or frequencies describing the bootstrap sample.  Any other arguments must be supplied to tilt.boot and will be passed unchanged to statistic each time it is called.  
一种应用于数据时,函数返回一个向量,包含利益的统计(S)。它必须至少有两个参数。第一个参数将始终是data第二,应该是一个指数,重量或描述引导样本的频率矢量。必须提供任何其他参数tilt.boot,将通过统计每个被调用时不变。


参数:R
The number of bootstrap replicates required.  This will generally be a vector, the first value stating how many uniform bootstrap simulations are to be performed at the initial stage.  The remaining values of R are the number of simulations to be performed resampling from each reweighted distribution. The first value of R must always be present, a value of 0 implying that no uniform resampling is to be carried out.  Thus length(R) should always equal 1+length(theta).  
需要引导的数量复制。这通常会是一个向量,说明多少统一引导模拟的第一个值是在初始阶段进行。 R的剩余价值是从每个重加权分布进行重采样的模拟数。 R的第一个值必须始终存在,暗示要进行的是没有统一的重采样值为0。因此length(R)应该始终等于1+length(theta)。


参数:sim
This is a character string indicating the type of bootstrap simulation required.  There are only two possible values that this can take: "ordinary" and "balanced".  If other simulation types are required for the initial un-weighted bootstrap then it will be necessary to run boot, calculate the weights appropriately, and run boot again using the calculated weights.  
这是一个字符串,指示引导所需的模拟类型。有只有两个可能的值,这可以采取:"ordinary"和"balanced"。如果其他的仿真类型所需的初始未加权引导,那么这将是必要的运行boot,计算适当的重量,并运行boot再次使用的计算权重。


参数:stype
A character string indicating the type of second argument expected by statistic.  The possible values that stype can take are "i" (indices), "w" (weights) and "f" (frequencies).  
一个字符串表明statistic预计第二个参数类型。 stype可以采取可能的值是"i"(指数),"w"(重)和"f"(频率)。


参数:strata
An integer vector or factor representing the strata for multi-sample problems.  
一个整数向量或代表的阶层为多样品问题的因素。


参数:L
The empirical influence values for the statistic of interest.  They are used only for exponential tilting when tilt is TRUE.  If tilt is TRUE and they are not supplied then tilt.boot uses empinf to calculate them.  
利益的统计经验的影响值。他们只用于指数倾斜时tilt是TRUE。如果tilt是TRUE他们没有提供那么tilt.boot使用empinf计算。


参数:theta
The required parameter value(s) for the tilted distribution(s). There should be one value of theta for each of the non-uniform distributions.  If R[1] is 0 theta is a required argument.  Otherwise theta values can be estimated from the initial uniform bootstrap and the values in alpha.  
倾斜的分配(S)所需的参数值(S)。应该有theta每个非均匀分布的值。如果R[1]0“theta是一个必需的参数。否则theta值可以从最初的统一引导和值在alpha估计。


参数:alpha
The alpha level to which tilting is required.  This parameter is ignored if R[1] is 0 or if theta is supplied, otherwise it is used to find the values of theta as quantiles of the initial uniform bootstrap.  In this case R[1] should be large enough that min(c(alpha, 1-alpha))*R[1] > 5, if this is not the case then a warning is generated to the effect that the theta are extreme values and so the tilted output may be unreliable.   
倾斜需要α水平。此参数将被忽略,如果R[1]0或theta如果提供,否则将被用来寻找的值theta初步统一引导位数。在这种情况下R[1]应该足够大,min(c(alpha, 1-alpha))*R[1] > 5,如果这种情况并非如此,那么一个警告产生的影响theta是极端值,因此倾斜的输出可能不可靠的。


参数:tilt
A logical variable which if TRUE (the default) indicates that exponential tilting should be used, otherwise local frequency smoothing (smooth.f) is used.  If tilt is FALSE then R[1] must be positive.  In fact in this case the value of R[1] should be fairly large (in the region of 500 or more).  
逻辑变量,如果TRUE(默认)表示,指数倾斜,应使用频率平滑,否则本地(smooth.f)用于。 tilt如果是FALSE然后R[1]必须是积极的。事实上,在这种情况下,R[1]应该是相当大的(在500个或更多的区域)的价值。


参数:width
This argument is used only if tilt is FALSE, in which case it is passed unchanged to smooth.f as the standardized bandwidth for the smoothing operation.  The value should generally be in the range (0.2, 1). See smooth.f for for more details.  
这种说法是用来只有tilt是FALSE,在这种情况下,它是通过不变smooth.f平滑操作的标准化带宽。值一般应在范围内(0.2 1)。看到smooth.f为了解更多的细节。


参数:index
The index of the statistic of interest in the output from statistic.  By default the first element of the output of statistic is used.  
在从statistic输出利益的统计指标。默认情况下使用的第一个元素输出statistic“。


参数:...
Any additional arguments required by statistic.  These are passed unchanged to statistic each time it is called.  
statistic所需的任何额外的参数。这些都是通过不变statistic每次它被称为。


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

An object of class "boot" with the following components
"boot"类以下组件的对象


参数:t0
The observed value of the statistic on the original data.  
对原始数据的统计观测值。


参数:t
The values of the bootstrap replicates of the statistic.  There will be sum(R) of these, the first R[1] corresponding to the uniform bootstrap and the remainder to the tilted bootstrap(s).  
引导值,重复统计。会有sum(R)这些,第一个R[1]相应的统一引导和倾斜引导(S)的其余部分。


参数:R
The input vector of the number of bootstrap replicates.  
复制的引导的输入向量。


参数:data
The original data as supplied.  
作为原始数据提供。


参数:statistic
The statistic function as supplied.  
statistic正常供应。


参数:sim
The simulation type used in the bootstrap(s), it can either be "ordinary" or "balanced".  
模拟类型用于引导(S),它可以是"ordinary"或"balanced"。


参数:stype
The type of statistic supplied, it is the same as the input value stype.  
提供的统计,它是作为输入值stype。


参数:call
A copy of the original call to tilt.boot.  
原来的呼叫tilt.boot副本。


参数:strata
The strata as supplied.  
作为提供地层。


参数:weights
The matrix of weights used.  If R[1] is greater than 0 then the first row will be the uniform weights and each subsequent row the tilted weights. If R[1] equals 0 then the uniform weights are omitted and only the tilted weights are output.  
使用权重矩阵。 R[1]如果大于0,那么第一行,将是统一的重量和每个后续行倾斜的重量。如果R[1]等于0,那么统一的重量被忽略和倾斜重量输出。


参数:theta
The values of theta used for the tilted distributions.  These are either the input values or the values derived from the uniform bootstrap and alpha.  
theta倾斜分布的值。这些都是来自统一引导的输入值或值和alpha。


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

for the bootstrap. Annals of Statistics, 21, 286–298.
Bootstrap Methods and Their Application. Cambridge University Press.
Biometrika, 76, 435–446.

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

boot, exp.tilt, Imp.Estimates, imp.weights, smooth.f
boot,exp.tilt,Imp.Estimates,imp.weights,smooth.f


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


# Note that these examples can take a while to run.[请注意,这些例子可能需要一段时间来运行。]

# Example 9.9 of Davison and Hinkley (1997).[示例9.9戴维森和欣克利(1997)。]
grav1 <- gravity[as.numeric(gravity[,2]) >= 7, ]
grav.fun <- function(dat, w, orig) {
     strata <- tapply(dat[, 2], as.numeric(dat[, 2]))
     d <- dat[, 1]
     ns <- tabulate(strata)
     w <- w/tapply(w, strata, sum)[strata]
     mns &lt;- as.vector(tapply(d * w, strata, sum)) # drop names[下降的名字]
     mn2 <- tapply(d * d * w, strata, sum)
     s2hat <- sum((mn2 - mns^2)/ns)
     c(mns[2]-mns[1],s2hat,(mns[2]-mns[1]-orig)/sqrt(s2hat))
}
grav.z0 <- grav.fun(grav1, rep(1, 26), 0)
tilt.boot(grav1, grav.fun, R = c(249, 375, 375), stype = "w",
          strata = grav1[,2], tilt = TRUE, index = 3, orig = grav.z0[1])


#  Example 9.10 of Davison and Hinkley (1997) requires a balanced [戴维森和欣克利(1997)9.10例子需要平衡]
#  importance resampling bootstrap to be run.  In this example we [重要性重采样引导运行。在这个例子中,我们]
#  show how this might be run.  [显示,这可能是如何运行的。]
acme.fun <- function(data, i, bhat) {
     d <- data[i,]
     n <- nrow(d)
     d.lm <- glm(d$acme~d$market)
     beta.b <- coef(d.lm)[2]
     d.diag <- boot::glm.diag(d.lm)
     SSx <- (n-1)*var(d$market)
     tmp <- (d$market-mean(d$market))*d.diag$res*d.diag$sd
     sr <- sqrt(sum(tmp^2))/SSx
     c(beta.b, sr, (beta.b-bhat)/sr)
}
acme.b <- acme.fun(acme, 1:nrow(acme), 0)
acme.boot1 <- tilt.boot(acme, acme.fun, R = c(499, 250, 250),
                        stype = "i", sim = "balanced", alpha = c(0.05, 0.95),
                        tilt = TRUE, index = 3, bhat = acme.b[1])

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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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