mask.check(secr)
mask.check()所属R语言包:secr
Mask Diagnostics
面膜诊断
译者:生物统计家园网 机器人LoveR
描述----------Description----------
mask.check evaluates the effect of varying buffer width and mask spacing on either the likelihood or density estimates from secr.fit()
mask.check的效果进行评估的不同缓冲区的宽度和掩码间距的可能性或密度估计从secr.fit()
用法----------Usage----------
mask.check(object, buffers = NULL, spacings = NULL, poly = NULL,
LLonly = TRUE, realpar = NULL, session = 1, file = NULL,
drop = "", tracelevel = 0, ...)
参数----------Arguments----------
参数:object
object of class "capthist" or "secr"
对象类的capthist“或”秘书服务“
参数:buffers
vector of buffer widths
矢量缓冲区的宽度
参数:spacings
vector of mask spacings
向量的面膜间隔
参数:poly
matrix of two columns, the x- and y-coordinates of a bounding polygon (optional)
两列,矩阵的x和y坐标的边界多边形(可选)
参数:LLonly
logical; if TRUE then only the log likelihood is computed
逻辑,如果TRUE,则仅计算对数似然
参数:realpar
list of parameter values
的参数值列表
参数:session
vector of session indices (used if object spans multiple sessions)
如果object跨越多个会话的会话指数(矢量)
参数:file
name of output file (optional)
输出文件的名称(可选)
参数:drop
character vector: names of fitted secr object to omit
字符向量:合身的秘书服务对象的名字省略
参数:tracelevel
integer for level of detail in reporting (0,1,2)
报告的详细程度的整数(0,1,2)
参数:...
other arguments passed to secr.fit
其他参数传递给secr.fit
Details
详细信息----------Details----------
Masks of varying buffer width and spacing are constructed with the "trapbuffer" method in make.mask, using the detector locations ("traps") from either a capthist object or a previous execution of secr.fit. Default values are provided for buffers and spacings if object is of class "secr" (respectively c(1, 1.5, 2) and c(1, 0.75, 0.5) times the values in the existing mask). The default for buffers will not work if a detector is on the mask boundary, as the inferred buffer is then 0.
告警缓冲区的方法,在不同缓冲区的宽度和间距均采用面具make.mask,无论是从capthist的物体或上一次执行secr.fit使用的检测器的位置(陷阱)。提供默认值buffers和spacings如果object类“秘书服务”(分别为C(1,1.5,2)和c(1,0.75,0.5)次现有的掩模中的值)。默认为buffers将无法正常工作,如果探测器是在蒙版上边界,推断的缓冲,然后按0。
Variation in the mask may be assessed for its effect on –
掩码中的变化,可评估其对 -
the log-likelihood evaluated for given values of the parameters (LLonly = TRUE)
对于给定的参数值计算对数似然(LLonly = TRUE)
estimates from maximizing the likelihood with each mask (LLonly = FALSE)
估计最大化的可能性,每个面具(LLonly = FALSE)
realpar should be a list with one named component for each real parameter (see Examples). It is relevant only if LLonly = TRUE. realpar may be omitted if object is of class "secr"; parameter values are then extracted from object.
realpar应该是一个列表,一个名为组件的每一个实际参数(见例)。这是有关的只有LLonly = TRUE。 realpar可能被省略,如果object是类的SECR“参数值,然后提取object。
session should be an integer or character vector suitable for indexing sessions in object, or in object$capthist if object is a fitted model. Each session is considered separately; a model formula that refers to session or uses session covariates will cause an error.
session应该是一个整数或字符表达向量的索引会话中object,或在object$capthist如果object是一个合适的模型。每个会话单独考虑;模型公式,是指会话,或使用会话协变量将导致一个错误。
If file is specified then detailed results (including each model fit when LLonly = FALSE) are saved to an external .RData file. Loading this file creates or overwrites object(s) in the workspace: mask.check.output if LLonly = TRUE, otherwise mask.check.output and mask.check.fit. For multiple sessions these are replaced by lists with one component per session (mask.check.outputs and mask.check.fits). The drop argument is passed to trim and applied to each fitted model; use it to save space, at the risk of limiting further computation on the fitted models.
如果file指定了详细的结果(包括各模型的拟合时LLonly = FALSE)将被保存到外部。RDATA文件。加载此文件在工作区中创建或覆盖对象(S):mask.check.output如果LLonly = TRUE,否则mask.check.output和mask.check.fit。对于这些被替换多个会话列表,每节的一个组成部分(mask.check.outputs和mask.check.fits)。 drop参数传递给trim适用于每个拟合模型,用它来节省空间,限制进一步的拟合模型计算的风险。
tracelevel>0 causes more verbose reporting of progress during execution.
tracelevel>0会导致更详细的报告,在执行过程中的进展。
The ... argument may be used to override existing settings in object - for example, a conditional likelihood fit (CL = T) may be selected even if the original model was fitted by maximizing the full likelihood.
该...参数可用于覆盖现有的设置object - 例如,一个条件可能适合(CL = T)的可能被选中,即使原始模型拟合,进一步充分发挥的可能性。
值----------Value----------
Array of log-likelihoods (LLonly = TRUE) or estimates (LLonly = FALSE) for each combination of buffers and spacings. The array has 3 dimensions if LLonly = FALSE and both buffers and spacings have multiple levels; otherwise it collapses to a matrix. Rows generally represent buffers, but rows represent spacings if a single buffer is specified.
阵列登录似然(LLonly = TRUE)或估计每个组合LLonly = FALSE和buffers(spacings)。数组有3个方面如果LLonly = FALSE和两个buffers和spacings有多个级别,否则它缩短为一个矩阵。行一般buffers,但行表示spacings,如果指定一个缓冲区。
警告----------Warning----------
mask.check() may fail if object is a fitted "secr" model and a data object named in the original call of secr.fit() (i.e. object$call) is no longer in the working environment (secr.fit arguments capthist, mask, verify & trace are exempt). Fix by any of (1) applying mask.check directly to the "capthist" object, specifying other arguments (buffers, spacings, realpar) as needed, (2) re-fitting the model and running mask.check in the same environment, (3) specifying the offending argument(s) in ..., or (4) re-creating the required data objects(s) in the working environment, possibly from saved inputs in object (e.g., mytimecov <- myfit$timecov).
mask.check()可能会失败,如果object是一个装有“秘书服务”的模式和数据对象命名为secr.fit()(即object$call)不再是工作在原来的呼叫环境(secr.fit的参数capthist,面膜,验证及追踪豁免)。修复(1)申请mask.check直接向“capthist的对象,指定其他参数(buffers,spacings,realpar)根据需要,(2)重新装修模式和运行mask.check在同样的环境,(3)指定问题的参数(S)...,(4)重新创建所需的数据对象(S)的工作环境,可能是从保存的投入object(例如,mytimecov <- myfit$timecov)。
注意----------Note----------
When LLonly = TRUE the functionality of mask.check resembles that of the "Tools | ML SECR log likelihood" menu option in Density 4. The help page in Density 4 for ML SECR 2-D integration (see index) may be helpful.
当LLonly = TRUEmask.check的功能类似于“工具”|“的ML SECRlog可能性”菜单选项中密度4。 4 ML SECR 2-D集成(指数)密度的帮助页面中可能会有所帮助。
Warning messages from secr.fit are suppressed. "capthist" data provided via the object argument are checked with verify.capthist if tracelevel > 0.
从secr.fit的警告信息会被抑制。 “capthist的数据通过object参数检查verify.capthist如果tracelevel > 0。
The likelihood-only method is fast, but not definitive. It is reasonable to aim for stability in the third decimal place of the log likelihood. Slight additional variation in the likelihood may cause little change in the estimates; the only way to be sure is to check these by setting LLonly = FALSE.
的可能性,唯一的方法是快速的,但不是绝对的。这是合理的目标稳定在小数点后第三位的对数似然。可能会导致轻微的额外变化的可能性估计变化不大,只有这样,才能确保检查这些设置LLonly = FALSE。
The performance of a mask depends on the detection function; be sure to set the detectfn argument appropriately. The hazard rate function has a fat tail that can be problematic.
口罩的性能取决于检测功能,确保适当设置detectfn参数。危险率函数的脂肪的尾巴,可能会出现问题。
When provided with an "secr" object, mask.check constructs a default vector of buffer widths as multiples of the buffer used in object even though that value is not saved explicitly. For this trick, detector locations in traps(object$capthist) are compared to the bounding box of object$mask; the base level of buffer width is the maximum possible within the bounding box.
提供的“秘书服务”object,mask.check构造一个默认的矢量缓冲区的宽度所用的缓冲区的倍数object即使该值不会被保存明确。这一招,探测器位置的traps(object$capthist)相比的边界框object$mask;缓冲区的宽度是最大可能在边界框的基本水平。
参考文献----------References----------
likelihood methods for capture–recapture studies. Biometrics 64, 377–385.
capture–recapture. Department of Zoology, University of Otago, Dunedin, New Zealand http://www.otago.ac.nz/density.
参见----------See Also----------
esa.plot, make.mask, secr.fit
esa.plot,make.mask,secr.fit
实例----------Examples----------
## Not run: [#不运行:]
## from a capthist object, specifying almost everything[#,从capthist对象,几乎所有的指定]
mask.check (possumCH, spacings = c(20, 30), buffers =c(200, 300),
realpar = list(g0 = 0.2, sigma = 50), CL = TRUE)
## from a fitted model, using defaults[从拟合模型,使用默认值#]
mask.check (stoat.model.HN)
## LL did not change with varying buffer (rows) or spacing (cols):[#LL没有改变具有不同的缓冲液(行)或间距(列):]
## 78.125 58.59375 39.0625[#78.125 58.59375 39.0625]
## 1000 -144.0015 -144.0015 -144.0015[#1000 -144.0015 -144.0015 -144.0015]
## 1500 -144.0017 -144.0017 -144.0017[#1500 -144.0017 -144.0017 -144.0017]
## 2000 -144.0017 -144.0017 -144.0017[#2000 -144.0017 -144.0017 -144.0017]
## fit new models for each combination of buffer & spacing,[#适应新的模型,每个组合的缓冲间距,]
## and save fitted models to a file[#,保存到一个文件中的拟合模型]
mask.check (stoat.model.HN, buffers = 1500, spacings =
c(40,60,80), LLonly = FALSE, file = "test", CL = TRUE)
## look in more detail at the preceding fits[#看看在前面的配合更详细的]
## restores objects `mask.check.output' and `mask.check.fit'[#恢复对象mask.check.output和mask.check.fit的“]
load("test.RData")
lapply(mask.check.fit, predict)
lapply(mask.check.fit, derived)
## multi-session data[多会话数据]
mask.check(ovenbird.model.1, session = c("2005","2009"))
## clipping mask[#剪贴蒙版]
olddir <- setwd(system.file("extdata", package = "secr"))
possumarea <- read.table("possumarea.txt", header = TRUE)
setwd(olddir)
data (possum)
mask.check (possum.model.0, spacings = c(20, 30), buffers =
c(200, 300), poly = possumarea, LLonly = FALSE,
file = "temp", CL = TRUE)
## review fitted models[#检查拟合模型。]
load ("temp.RData")
oldpar <- par(mfrow = c(2,2), mar = c(1,4,4,4), xpd = FALSE)
for (i in 1:4) {
plot(traps(mask.check.fit[[i]]$capthist), border = 300,
gridlines = FALSE)
plot(mask.check.fit[[i]]$mask, add = TRUE)
lines(possumarea)
text ( 2698618, 6078427, names(mask.check.fit)[i])
box()
}
par(oldpar)
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|