parboot(unmarked)
parboot()所属R语言包:unmarked
Parametric bootstrap method for fitted models inheriting class.
继承类的拟合模型参数的引导方法。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Simulate datasets from a fitted model, refit the model, and
从拟合模型模拟数据集,改装的模式,
参数----------Arguments----------
参数:object
a fitted model inheriting class "unmarkedFit"
一个合适的模型继承类“unmarkedFit”
参数:statistic
a function returning a vector of fit-statistics. First argument must be the fitted model. Default is sum of squared residuals.
一个函数返回一个矢量的装修统计。第一个参数必须是合适的模型。默认值是残差平方和。
参数:nsim
number of bootstrap replicates
一些引导复制
参数:report
print fit statistic every 'report' iterations during resampling
打印适合重采样的统计迭代过程中每一个“报告”
参数:...
Additional arguments to be passed to statistic </table>
其他参数可以通过统计</ TABLE>
Details
详细信息----------Details----------
This function simulates datasets based upon a fitted model, refits the model, and evaluates a user-specified fit-statistic for each simulation. Comparing this sampling distribution to the observed statistic provides a means of evaluating goodness-of-fit or assessing uncertainty in
该功能基于一个合适的模型来模拟数据集,改装的模型,并计算每个模拟用户指定的拟合统计量。本次抽查中观察到的统计分布比较适合善良的评估或评估的不确定性提供了一种手段
值----------Value----------
An object of class parboot with three slots:
一个对象的类parboot的三个插槽:
参数:call
parboot call
parboot呼叫
参数:t0
Numeric vector of statistics for original fitted model.
为原模型拟合统计的数字向量。
参数:t.star
nsim by length(t0) matrix of statistics for each simulation fit. </table>
NSIM长度(T0)矩阵统计每个模拟配合。 </ TABLE>
(作者)----------Author(s)----------
Richard Chandler <a href="mailto:rchandler@usgs.gov">rchandler@usgs.gov</a>
参见----------See Also----------
ranef
ranef
实例----------Examples----------
data(linetran)
(dbreaksLine <- c(0, 5, 10, 15, 20))
lengths <- linetran$Length
ltUMF <- with(linetran, {
unmarkedFrameDS(y = cbind(dc1, dc2, dc3, dc4),
siteCovs = data.frame(Length, area, habitat), dist.breaks = dbreaksLine,
tlength = lengths*1000, survey = "line", unitsIn = "m")
})
# Fit a model[拟合模型]
(fm <- distsamp(~area ~habitat, ltUMF))
# Function returning three fit-statistics.[函数返回三个合适的统计量。]
fitstats <- function(fm) {
observed <- getY(fm@data)
expected <- fitted(fm)
resids <- residuals(fm)
sse <- sum(resids^2)
chisq <- sum((observed - expected)^2 / expected)
freeTuke <- sum((sqrt(observed) - sqrt(expected))^2)
out <- c(SSE=sse, Chisq=chisq, freemanTukey=freeTuke)
return(out)
}
(pb <- parboot(fm, fitstats, nsim=25, report=1))
plot(pb, main="")
# Finite-sample inference for a derived parameter.[一个派生参数的有限样本推断。]
# Population size in sampled area[采样区域的人口规模]
Nhat <- function(fm) {
sum(bup(ranef(fm, K=50)))
}
set.seed(345)
(pb.N <- parboot(fm, Nhat, nsim=25, report=5))
# Compare to empirical Bayes confidence intervals[与经验Bayes置信区间的比较]
colSums(confint(ranef(fm, K=50)))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|