pcount(unmarked)
pcount()所属R语言包:unmarked
Fit the N-mixture model of Royle (2004)
适合N-混合模型的罗伊尔(2004年)
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Fit the N-mixture model of Royle (2004)
适合N-混合模型的罗伊尔(2004年)
用法----------Usage----------
参数----------Arguments----------
参数:formula
Double right-hand side formula describing covariates of detection and abundance, in that order
双右手边的公式描述的顺序检测和丰富的协变量,
参数:data
an unmarkedFramePCount object supplying data to the model.
unmarkedFramePCount对象提供数据的模型。
参数:K
Integer upper index of integration for N-mixture. This should be set high enough so that it does not affect the parameter estimates. Note that computation time will increase with K.
指数的集成N-混合整数上。这应设置足够高,以便它不会影响参数估计。需要注意的是,计算时间越长K.
参数:mixture
character specifying mixture: either "P" or "NB".
字符,指定混合物:无论是“P”或“NB”。
参数:starts
vector of starting values
向量的初始值
参数:method
Optimization method used by optim.
优化所使用的方法optim。
参数:se
logical specifying whether or not to compute standard errors.
逻辑指定是否计算标准误差。
参数:engine
Either "C" or "R" to use fast C++ code or native R code during the optimization.
无论是“C”或“R”使用快速的C + +代码或本机在优化过程中的R代码。
参数:...
Additional arguments to optim, such as lower and upper bounds
其他参数OPTIM,如上限和下限
Details
详细信息----------Details----------
This function fits N-mixture model of Royle (2004) to spatially replicated count data.
此功能适合N-混合模型的罗伊尔(2004)的空间复制的计数数据。
See unmarkedFramePCount for a description of how to format data for pcount.
见unmarkedFramePCount的说明如何格式化数据pcount的。
This function fits the latent N-mixture model for point count data (Royle 2004, K茅ry et al 2005).
此功能适合潜点计数数据(罗伊尔2004,柯瑞等人,2005年)的N-混合模型。
The latent abundance distribution, f(N | theta) can be set as a Poisson, negative binomial, or zero-inflated Poisson random variable, depending on the setting of the mixture argument, mixture = "P", mixture = "NB", mixture = "ZIP" respectively. For the first two distributions, the mean of N_i is lambda_i. If N_i ~ NB, then an additional parameter, alpha, describes dispersion (lower alpha implies higher variance). For the ZIP distribution, the mean is lambda*(1-psi), where psi is the zero-inflation parameter.
的潜在丰富分布,f(N | theta)的,可以设置为一个负二项分布,泊松分布,或零膨胀Poisson随机变量,根据mixture参数的设置,mixture = "P",<X >,mixture = "NB"“。对于前两种分布,平均mixture = "ZIP"是N_i。如果lambda_i,然后一个额外的参数,N_i ~ NB,介绍了分散(下alpha意味着更高的方差)。平均对于ZIP分配,是alpha,PSI是零通胀的参数。
The detection process is modeled as binomial: y_ij ~ Binomial(N_i, p_ij).
在检测过程中被建模为二项:y_ij ~ Binomial(N_i, p_ij)。
Covariates of lamdba_i use the log link and
lamdba_i使用log链接和协变量
值----------Value----------
unmarkedFit object describing the model fit.
描述模型拟合unmarkedFit对象。
(作者)----------Author(s)----------
Ian Fiske and Richard Chandler
参考文献----------References----------
Spatially Replicated Counts. Biometrics 60, pp. 108–105.
Replicated Counts Using Binomial Mixture Models. Ecological Applications 15(4), pp. 1450–1461.
Distributions, 3rd ed. Wiley.
参见----------See Also----------
unmarkedFramePCount, pcountOpen, ranef, parboot
unmarkedFramePCount,pcountOpen,ranef,parboot
实例----------Examples----------
# Simulate data[模拟数据]
set.seed(35)
nSites <- 100
nVisits <- 3
x <- rnorm(nSites) # a covariate[协变量]
beta0 <- 0
beta1 <- 1
lambda <- exp(beta0 + beta1*x) # expected counts at each site[预计在每个站点数]
N <- rpois(nSites, lambda) # latent abundance[潜在的丰富]
y <- matrix(NA, nSites, nVisits)
p <- c(0.3, 0.6, 0.8) # detection prob for each visit[每次访问的检测概率]
for(j in 1:nVisits) {
y[,j] <- rbinom(nSites, N, p[j])
}
# Organize data[组织数据]
visitMat <- matrix(as.character(1:nVisits), nSites, nVisits, byrow=TRUE)
umf <- unmarkedFramePCount(y=y, siteCovs=data.frame(x=x),
obsCovs=list(visit=visitMat))
summary(umf)
# Fit a model[拟合模型]
fm1 <- pcount(~visit-1 ~ x, umf, K=50)
fm1
plogis(coef(fm1, type="det")) # Should be close to p[应接近到p]
# Empirical Bayes estimation of random effects[随机效应的经验Bayes估计]
(fm1re <- ranef(fm1))
plot(fm1re, subset=site %in% 1:25, xlim=c(-1,40))
sum(bup(fm1re)) # Estimated population size[预计人口规模]
colSums(confint(fm1re)) # and 95% CI[95%CI]
sum(N) # Actual population size[实际人口规模]
## Not run: [#不运行:]
# Real data[实时数据]
data(mallard)
mallardUMF <- unmarkedFramePCount(mallard.y, siteCovs = mallard.site,
obsCovs = mallard.obs)
(fm.mallard <- pcount(~ ivel+ date + I(date^2) ~ length + elev + forest, mallardUMF, K=30))
(fm.mallard.nb <- pcount(~ date + I(date^2) ~ length + elev, mixture = "NB", mallardUMF, K=30))
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|