Description Usage Arguments Value Examples
View source: R/estimateL.EoA.R
This routine computes lambda, the mean number of search targets
out there per season,
using information from the number of found targets and the g-value (=probatility of
discovery). This differs from the eoar()
function in that
this routine does not allow covariates (mean model only).
The method is Bayesian and allows either an uniform prior for lambda
or an informed prior.
Estimation is direct in the sense that this routine uses numerical
integration to compute the posterior of lambda.
1 2 3 4 5 6 7 8 | estimateL.EoA(
X,
beta.params,
Lprior = "jeffreys",
Lprior.mean = NULL,
Lprior.sd = NULL,
conf.level = 0.9
)
|
X |
Total number of search targets found at all searched sites during the entire search season. |
beta.params |
A list containing, at a minimum, components named $alpha and $beta.
These are the all-site alpha and beta parameters for g. In many cases, these parameters
are computed using function |
Lprior |
A string naming the prior distribution to use for lambda. The following priors are implimented:
|
Lprior.mean |
Mean of lambda prior when Lprior == "normal" or "gamma". |
Lprior.sd |
Standard deviation of normal when Lprior == "normal" or "gamma". |
conf.level |
Confidence level for the confidence intervals on lambda. |
List containing two components:
$L.ests
is a data
frame containing the lambda estiamtes (point estimate and confidence interval).
$L.posterior
is a data frame containing the
posterior, posterior cdf, prior, and likelihood. This is returned in case
you want to plot them.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | syr <- data.frame(species=c("LBBA","LBBA","LBBA"),
facility=c("f1","f2","f2"),
gFac.a = c( 69.9299, 63.5035, 84.6997),
gFac.b = c( 736.4795, 318.3179, 759.9333 ),
year = c(2015,2015,2016))
g <- getFleetG(syr, "LBBA"))
eoa <- estimateL.EoA( 1, g ) # Un-informed EoA
ieoa <- estimateL.EoA( 1, g, Lprior="normal", Lprior.mean=20, Lprior.sd=4) # Informed EoA
# interesting plot showing movement of posterior
plot(ieoa$L.posterior$L, ieoa$L.posterior$pdf, type="l")
lines(ieoa$L.posterior$L, ieoa$L.posterior$like.pdf, col="red")
lines(ieoa$L.posterior$L, ieoa$L.posterior$prior.pdf, col="blue")
legend("topright", legend=c("prior","likelihood","posterior"), col=c("blue","red","black"), lty=1)
# to check that integral is correct.
flike <- function(x, est){
approx(est$L.posterior$L, est$L.posterior$like.pdf,xout=x, rule=2)$y
}
integrate( flike, min(ieoa$L.posterior$L), max(ieoa$L.posterior$L), est=ieoa)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.