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

R语言 secr包 sim.secr()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 00:05:12 | 显示全部楼层 |阅读模式
sim.secr(secr)
sim.secr()所属R语言包:secr

                                         Simulate From Fitted secr Model
                                         模拟从合身秘书服务模型

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

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

Simulate a spatially distributed population, sample from that population with an array of detectors, and optionally fit an SECR model to the simulated data.
模拟,人口空间分布的人口,样本的探测器阵列,,和选择适合的SECR模型,模拟数据。


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



## S3 method for class 'secr'
simulate(object, nsim = 1, seed = NULL, maxperpoly = 100,
    chat = 1, ...)

sim.secr(object, nsim = 1, extractfn = function(x) c(deviance =
    deviance(x), df = df.residual(x)), seed = NULL, maxperpoly = 100,
    data = NULL, tracelevel = 1, hessian = "none", start = object$fit$par)




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

参数:object
an secr object
秘书服务对象


参数:nsim
number of replicates
重复次数


参数:seed
value for setting .Random.seed - either NULL or an integer
值进行设置。Random.seed  - 无论是NULL或整数


参数:maxperpoly
integer maximum number of detections of an individual in one polygon or transect on any occasion  
一个人在一个多边形或在任何场合样的检测整数的最大数量


参数:chat
real value for overdispersion parameter
差的参数的实际值


参数:extractfn
function to extract output values from fitted model
函数来提取输出值拟合模型


参数:data
optional list of simulated data saved from previous call to simulate.secr
可选列表的保存从以前调用simulate.secr的的模拟数据


参数:tracelevel
integer for level of detail in reporting (0,1,2)
报告的详细程度的整数(0,1,2)


参数:hessian
character or logical controlling the computation of the Hessian matrix
字符或逻辑控制的Hessian矩阵计算


参数:start
vector of starting "beta" values for secr.fit
矢量的开始测试版值secr.fit


参数:...
other arguments (not used)
其他参数(未使用)


Details

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

For each replicate, simulate.secr calls sim.popn to generate session- and group-specific realizations of the (possibly inhomogeneous) 2-D Poisson distribution fitted in object, across the habitat mask(s) in object.  Group subpopulations are combined using rbind.popn within each session; information to reconstruct groups is retained in the individual-level factor covariate(s) of the resulting popn object (corresponding to object$groups).  Each population is then sampled using the fitted detection model and detector (trap) array(s) in object.
对于每个复制,simulate.secr调用sim.popn来生成会话和特定组实现的(可能是不均匀的)2-D泊松分布安装在object,整个栖息地屏蔽(S)在object。组亚群被结合使用rbind.popn每个会话内;重建组的信息被保留在个体水平的因子(s)的所得popn对象(对应object$groups)的协变量。每个群体,然后采样,使用拟合检测模型和检测器(陷阱)阵列(s)在object。

The random number seed is managed as in simulate.lm.
随机数种子管理作为在simulate.lm。

simulate.secr does not yet work with models fitted using conditional likelihood (object$CL = TRUE).  Detector type is determined by detector(traps(object$capthist)), which should be one of "single", "multi", "proximity", "areasearch" or "count".
simulate.secr不还配车型安装使用条件的可能性(object$CL = TRUE)。探测器类型是由detector(traps(object$capthist)),这应该是一个“单一”,“多”,“近水楼台”,“areasearch”或“计数”。

sim.secr is a wrapper function. If data = NULL (the default) then it calls simulate.secr to generate nsim new datasets. If data is provided then nsim is taken to be length(data). secr.fit is called to fit the original model to each new dataset. Results are summarized according to the user-provided function extractfn. The default extractfn returns the deviance and its degrees of freedom; a NULL value for extractfn returns the fitted secr objects after trimming to reduce bulk. Simulation uses the detector type of the data, even when another likelihood is fitted (this is the case with single-catch data, for which a multi-catch likelihood is fitted). Warning messages from secr.fit are suppressed.
sim.secr是一个包装函数。如果data = NULL(默认值),然后它调用simulate.secr,生成nsim新的数据集。如果data提供然后nsim是length(data)。 secr.fit被称为原始模型,以适应每一个新的数据集。结果总结根据用户提供的函数extractfn。默认extractfn返回的异常行为及其自由度;extractfn返回一个NULL值的拟合后trim明的秘书服务对象,以降低对大。模拟使用的检测器的数据的类型,即使当另一个可能性(这是与单渔获量数据的情况下,其中一个多赶上可能性嵌合)嵌合。从secr.fit的警告信息会被抑制。

extractfn should be a function that takes an secr object as its only argument.
extractfn应该是一个函数,它接受一个secr对象作为其唯一的参数。

tracelevel=0 suppresses most messages; tracelevel=1 gives a terse message at the start of each fit; tracelevel=2 also sets "details$trace = TRUE" for secr.fit, causing each likelihood evaluation to be reported.
tracelevel=0抑制大多数邮件;tracelevel=1给出了一个简短的消息开始在各装配; tracelevel=2组的详细信息$ TRACE = TRUE为secr.fit,使每个可能性评价报告。

hessian controls computation of the Hessian matrix from which variances and covariances are obtained. hessian replaces the value in object\$details.  Options are "none" (no variances), "auto" (the default) or "fdhess" (see secr.fit). It is OK (and faster) to use hessian="none" unless extractfn needs variances or covariances. Logical TRUE and FALSE are interpreted by secr.fit as "auto" and "none".
hessian控制计算Hessian矩阵方差和协方差得到。 hessian在object\$details的值替换。选项是“无”(无差异),“自动”(默认值)或“fdhess”(见secr.fit“)。这是确定的(更快)使用hessian="none"除非extractfn需要方差或协方差。逻辑值TRUE和FALSE解释secr.fit为“自动”和“无”。

sim.capthist is a more direct way to simulate data from a null model (i.e. one with constant parameters for density and detection).
sim.capthist是更直接的方式来模拟一个空的数据模型(即一个恒定的密度和检测参数)。


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

For simulate.secr, a list of data sets ("capthist" objects). This list has class c("list","secrdata"); the initial state of the random number generator (roughly, the value of .Random.seed) is stored as the attribute "seed".
对于simulate.secr,数据集(“capthist”对象的列表)。此列表类的随机数发生器(粗略地说,的价值。Random.seed)存储属性“种子”,c("list","secrdata");初始状态。

The value from sim.secr depends on extractfn: if that returns a numeric vector of length n.extract then the value is a matrix with dim = c(nsim, n.extract) (i.e., the matrix has one row per replicate and one column for each extracted value). Otherwise, the value returned by sim.secr is a list with one component per replicate (strictly, an object of class = c("list","secrlist")). Each simulated fit may be retrieved in toto by specifying extractfn = identity, or slimmed down by specifying extractfn = NULL or extractfn = trim, which are equivalent.
值sim.secr取决于extractfn:如果返回一个数值向量的长度n.extract那么这个值是一个矩阵dim = c(nsim, n.extract)(即,矩阵每行复制和对每个提取的值的一列)。否则,返回的值sim.secr的一个组成部分,每重复的列表(严格,类的一个对象=c("list","secrlist"))。每个模拟可以检索出合适的TOTO通过指定extractfn = identity,extractfn = NULL或extractfn = trim,这是相当于或缩小。

For either form of output from sim.secr the initial state of the random number generator is stored as the attribute "seed".
对于任何一种形式的输出从sim.secr的随机数发生器的初始状态被存储作为属性的“种子”。


注意----------Note----------

The value returned by simulate.secr is a list of "capthist" objects; if there is more than one session, each "capthist" is itself a sort of list .
simulate.secr的返回值是一个列表的“capthist”对象,如果有一个以上的会话,每个“capthist”本身就是一个排序的列表。

The classes "secrdata" and "secrlist" are used only to override the ugly and usually unwanted printing of the seed attribute. However, a few other methods are available for "secrlist" objects (e.g. plot.secrlist).
类的secrdata“和”secrlist“仅用于覆盖丑陋的,通常不需要打印的种子属性。然而,其他一些方法可用于“secrlist”的对象(如:plot.secrlist)。

The default value for start in sim.secr is the previously fitted parameter vector. Alternatives are NULL or object$start.
默认值start中sim.secr是以前安装的参数向量。替代品为NULL或object$start。


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

sim.capthist, secr.fit, simulate
sim.capthist,secr.fit,simulate


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



## previously fitted model[#预先安装模式]
simulate(secrdemo.0, nsim = 2)

## Not run: [#不运行:]

## this would take a long time...[#这将需要很长的时间...]
sims <- sim.secr(secrdemo.0, nsim = 99)
deviance(secrdemo.0)
devs <- c(deviance(secrdemo.0),sims$deviance)
quantile(devs, probs=c(0.95))
rank(devs)[1] / length(devs)

## to assess bias and CI coverage[#评估偏差和CI覆盖]
extrfn <- function (object) unlist(predict(object)["D",-1])
sims <- sim.secr(secrdemo.0, nsim = 50, hessian = "auto",
    extractfn = extrfn)
sims

## with a larger sample, could get parametric bootstrap CI[#一个较大的样本,可以得到参数的自举CI]
quantile(sims[,1], c(0.025, 0.975))


## End(Not run)[#(不执行)]


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-30 10:36 , Processed in 0.022790 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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