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

R语言 scaleboot包 sbfit()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-29 22:26:35 | 显示全部楼层 |阅读模式
sbfit(scaleboot)
sbfit()所属R语言包:scaleboot

                                        Fitting Models to Bootstrap Probabilities
                                         引导概率模型拟合

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

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

sbfit is used to fit parametric models to multiscale bootstrap probabilities by the maximum likelihood method.
sbfit使用适合的参数化模型的多尺度引导概率的最大似然法。


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


sbfit(x, ...)

## Default S3 method:[默认方法]
sbfit(x,nb,sa,models=NULL,nofit=FALSE,...)

## S3 method for class 'matrix':
sbfit(x,nb,sa,models=NULL,names.hp=rownames(x),
      nofit=FALSE,cluster=NULL,...)

## S3 method for class 'data.frame':
sbfit(x,...)

## S3 method for class 'scaleboot':
sbfit(x,models=names(x$fi),...)

## S3 method for class 'scalebootv':
sbfit(x,models=attr(x,"models"),...)

## S3 method for class 'scaleboot':
print(x,sort.by=c("aic","none"),...)

## S3 method for class 'scalebootv':
print(x,...)



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

参数:x
an object used to select a method. For sbfit.default, x is denoted by nb and is a vector of bootstrap probabilities for a hypothesis. For sbfit.matrix, x is denoted by bps and is a matrix with row vectors of bp for several hypotheses.
使用的对象选择方法。对于sbfit.default,x表示的nb是一个向量自举一个假设的概率。对于sbfit.matrix,x表示bps是一个矩阵的行向量bp几种假说。


参数:nb
vector of numbers of bootstrap replicates. A short vector (or scalar) is cyclically extended to match the size of bp.
向量自举的数字复制。一个的短向量(或标量)是循环的bp的大小相匹配。


参数:sa
vector of scales in sigma squared (σ^2). Should be the same size as bp.
向量的尺度sigma平方(σ^2“)。 bp应该是相同的大小。


参数:models
character vector of model names. Valid model names are poly.m for m>=1 and sing.m for m>=3. The default is set by sboptions()$models, whose default is c("poly.1","poly.2","poly.3","sing.3","sphe.3"). If models is an integer value, sbmodelnames(m=models) is used.
模型名称的字符向量。有效的模型名称是poly.mM> = 1和sing.mM> = 3。默认设置的sboptions()$models,其默认是C(“poly.1”,“poly.2”,“poly.3”,“sing.3”,“sphe.3”)。如果models是一个整数值,sbmodelnames(m=models)使用。


参数:nofit
logical. If TRUE, fitting is not performed.
逻辑。如果是TRUE,配件不被执行。


参数:names.hp
character vector of hypotheses names.
假设名称的字符向量。


参数:cluster
snow cluster object which may be generated by function makeCluster.
snow的聚类对象可能产生的功能makeCluster。


参数:sort.by
sort key.
排序键。


参数:...
further arguments passed to and from other methods.  
进一步的参数传递给其他方法。


Details

详细信息----------Details----------

sbfit.default fits parametric models to bp by maximizing the log-likelihood value of a binomial model. A set of multiscale bootstrap resampling should be performed before a call to sbfit for preparing bp, where bp[i] is a bootstrap probability of a hypothesis calculated with a number of bootstrap replicates nb[i] and a scale σ^2=sa[i]. The scale is defined as σ^2=n/n', where n is the sample size of data, and n' is the sample size of replicated data for bootstrap resampling.
sbfit.defaultbp适合的参数化模型,二项式模型的对数似然值最大化。呼叫sbfit用于制备bp,其中bp[i]是自举与自举数计算一个假设的概率复制nb[i]的一组多尺度自举重采样之前,应执行和规模σ^2=sa[i]。的规模被定义为σ^2=n/n',其中n为样本数据的大小,和n'是引导复制的数据进行重采样的样本量。

Each model specifies a psi(beta,s)=ψ(σ^2 | β) function with a parameter vector β. The model may describe how the bootstrap probability changes along the scale. Let cnt[i]=bp[i]*nb[i] be the frequency indicating how many times the hypothesis of interest is observed in bootstrap replicates at scale sa[i]. Then we assume that cnt[i] is binomially distributed with number of trials nb[i] and success probability 1-pnorm(psi(beta,s=sa[i])/sqrt(sa[i])). Currently, sbpsi.poly and sbpsi.sing are available as ψ functions. The estimated model parameters are accessed by the coef.scaleboot method.
每个模型指定一个psi(beta,s)=ψ(σ^2 | β)的功能参数向量β。“该模型描述了如何引导概率沿着规模化的变化。让cnt[i]=bp[i]*nb[i]是频率指示多少次在bootstrap观察感兴趣的假说,在大规模复制sa[i]。然后,我们假定cnt[i]是二项式分布的试验次数nb[i]和成功概率1-pnorm(psi(beta,s=sa[i])/sqrt(sa[i]))。目前,sbpsi.poly和sbpsi.sing是ψ功能的。 coef.scaleboot方法估计模型参数进行访问。

The model fitting is performed in the order specified in models, and the initial values for numerical optimization of the likelihood function are prepared by using previously estimated model parameters. Thus, "poly.(m-1)" should be specified before "poly.m", and "poly.(m-1)" and "sing.(m-1)" should be specified before "sing.m".
在models指定的顺序进行模型拟合,和似然函数的数值优化的制备方法是使用先前估计的模型参数的初始值。因此,“聚(m-1的)”应指定之前的“poly.m”,和“聚(米-1)”和“唱歌。第(m-1)的”应之前指定“sing.m” 。

sbfit.matrix calls sbfit.default repeatedly, once for each row vector bp of the matrix bps.  Parallel computing is performed when cluster is non NULL.
sbfit.matrix要求sbfit.default反反复复,一次为每个行向量bp的矩阵bps。当cluster非NULL,并行计算执行。

sbfit.scaleboot calls sbfit.default with bp, nb, and sa components in x object for refitting by giving another models argument. It discards the previous result of fitting, and recomputes the model parameters.
sbfit.scaleboot调用sbfit.defaultbp,nb和sax对象发出另一个models参数的改装部件在。它摒弃了以前的拟合结果,并重新计算模型参数。

sbfit.scalebootv calls sbfit.matrix with the bps, nb, and sa components in the attributes of x.
sbfit.scalebootv调用sbfit.matrix的bps,nb和sa组件的属性x的。


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

sbfit.default and sbfit.scaleboot return an object of class "scaleboot", and sbfit.matrix and sbfit.scalebootv return an object of class "scalebootv".
sbfit.default和sbfit.scaleboot返回一个对象类"scaleboot"和sbfit.matrix和sbfit.scalebootv返回一个对象类"scalebootv"。

An object of class "scaleboot" is a list containing at least the following components: <table summary="R valueblock"> <tr valign="top"><td>bp</td> <td> the vector of bootstrap probabilities used.</td></tr> <tr valign="top"><td>nb</td> <td> the rep(nb,length=length(bp)) used.</td></tr> <tr valign="top"><td>sa</td> <td> the sa used. </td></tr> <tr valign="top"><td>fi</td> <td> list vector of fitted results for models used.  Each list consists of components "par" (estimated parameter), "mag" (magnification factor for "par" to make the actual parameter vector beta=par*mag), "value" (maximum log-likelihood), "hessian" (hessian matrix), "var" (variance estimate of "par"), "mask" (logical vector indicating parameter elements which are not at boundaries), "init" (initial values used for optimization), "psi" (psi function name of the model), "df" (degrees of freedom), "rss" (equivalent to the residual sum of squares, but actually defined as 2*(lik0-lik) where lik0 and lik are the log-likelihood function of the non-restricted model and the model of interest, respectively), "pfit" (p-value for "rss"), "aic" (aic value of the model relative to the non-restricted model).</td></tr>
一个对象的类"scaleboot"的是一个列表,其中至少包含以下组件:<table summary="R valueblock"> <tr valign="top"> <TD>bp </ TD> <TD >采用自举的概率向量。</ TD> </ TR> <tr valign="top"> <TD>nb </ TD> <TD>rep(nb,length=length(bp))。</ TD > </ TR> <tr valign="top"> <TD> sa</ TD> <TD>的sa使用。 </ TD> </ TR> <tr valign="top"> <TD>fi </ TD> <TD>列表向量的拟合结果models使用。每个列表组件"par"(估计参数),"mag"(放大倍数为"par"使实际参数向量beta=par*mag)"value"(最大log的可能性),"hessian"(Hessian矩阵),"var"(方差估计的"par")"mask"(逻辑向量,表示这是在边界的参数元素),<所述>(初始值用于优化),"init"(PSI功能的模型名称),"psi"(自由度),"df"(相当于残差平方和,但实际上定义为2 *(lik0力)lik0和力的非限制模型的对数似然函数和模型的兴趣,分别),"rss"(P-值"pfit" )"rss"(AIC值相对于非限制模型的模型)。</ TD> </ TR>

</table> An object of class "scalebootv" is a vector of "scaleboot" objects, and in addition, it has attributes "models", "bps", "nb", and "sa".
</表>一种的类"scalebootv"的对象是一个向量"scaleboot"对象,并且另外,它具有属性"models","bps","nb",和"sa"。


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


Hidetoshi Shimodaira &lt;shimo@is.titech.ac.jp&gt;



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

Shimodaira, H. (2002).  An approximately unbiased test of phylogenetic tree selection, Systematic Biology, 51, 492-508.
Shimodaira, H. (2004).  Approximately unbiased tests of regions using multistep-multiscale bootstrap resampling, Annals of Statistics, 32, 2616-2641.
Shimodaira, H. (2008). Testing Regions with Nonsmooth Boundaries via Multiscale Bootstrap, Journal of Statistical Planning and Inference, 138, 1227-1241. (http://dx.doi.org/10.1016/j.jspi.2007.04.001).

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

sbpsi, summary.scaleboot, plot.scaleboot, coef.scaleboot,
sbpsi,summary.scaleboot,plot.scaleboot,coef.scaleboot,


实例----------Examples----------


## Testing a hypothesis[#测试假设]
## Examples of fitting models to a vector of bp's[#示例拟合模型BP的一个向量]
## mam15.relltest$t4 of data(mam15), but[#mam15.relltest $ t4的数据(mam15)的,但]
## using a different set of scales (sigma^2 values).[#使用一组不同的尺度(σ^ 2值)。]
## In the below, sigma^2 ranges 0.01 to 100 in sa[i][#在下面,σ^ 2的范围在0.01至100个[I]]
## This very large range is only for illustration.[#这是非常大的范围,仅用于说明。]
## Typically, the range around 0.1 to 10[#通常情况下,约0.1至10的范围]
## is recommended for much better model fitting.[#被推荐为更好的模型拟合。]
## In other examples, we have used[#在其他示例中,我们已经使用]
## sa = 9^seq(-1,1,length=13).[#SA = 9 ^ SEQ(-1,1,长度= 13)。]

cnt <- c(0,0,0,0,6,220,1464,3565,5430,6477,6754,
         6687,5961) # observed frequencies at scales[在尺度的观测频率]
nb &lt;- 100000 # number of replicates at each scale[重复次数在每个尺度]
bp &lt;- cnt/nb # bootstrap probabilities (bp's)[引导概率(BP公司)]
sa &lt;- 10^seq(-2,2,length=13) # scales (sigma squared)[尺度(sigma平方)]
## model fitting to bp's [模型拟合BP的]
f &lt;- sbfit(bp,nb,sa) # model fitting ("scaleboot" object)[模型拟合(“scaleboot”对象)]
f # print the result of fitting[打印的拟合结果]
plot(f,legend="topleft") # observed bp's and fitted curves[观察BP和拟合曲线]
## approximately unbiased p-values[#约偏见的p-值]
summary(f) # calculate and print p-values[p-值计算和打印]
## refitting with models up to "poly.4" and "sing.4"[#改装型“poly.4”和“sing.4的”]
f <- sbfit(f,models=1:4)
f # print the result of fitting[打印的拟合结果]
plot(f,legend="topleft") # observed bp's and fitted curves[观察BP和拟合曲线]
summary(f) # calculate and print p-values[p-值计算和打印]

## Testing multiple hypotheses (only two here)[#测试多种假设(只有两个在这里)]
## Examples of fitting models to vectors of bp's[#例如BP的拟合模型的向量]
## mam15.relltest[c("t1,t2")][#mam15.relltest [C(T1,T2“)]]
cnt1 <- c(85831,81087,76823,72706,67946,62685,57576,51682,
       45887,41028,35538,31232,27832)  # cnt for "t1"[CNT为“T1”]
cnt2 <- c(2,13,100,376,975,2145,3682,5337,7219,8559,
       10069,10910,11455)  # cnt for "t2"[碳纳米管为为“t2”]
cnts <- rbind(cnt1,cnt2)
nb &lt;- 100000 # number of replicates at each scale[重复次数在每个尺度]
bps &lt;- cnts/nb # row vectors are bp's[行向量BP的]
sa &lt;- 9^seq(-1,1,length=13) # scales (sigma squared)[尺度(sigma平方)]
fv &lt;- sbfit(bps,nb,sa) # returns a "scalebootv" object[返回对象的“scalebootv”]
fv # print the result of fitting[打印的拟合结果]
plot(fv) # multiple plots[多条曲线]
summary(fv) # calculate and print p-values[p-值计算和打印]


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-14 04:47 , Processed in 0.023056 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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