| oneStep.like | R Documentation |
Compute likelihood function for a mixture of two uniform distributions.
oneStep.like(a, dist, covars, w.hi = NULL)
a |
A vector or matrix of covariate
and expansion term
coefficients. If matrix, dimension is
k X p, where
k = |
dist |
A numeric vector of length n or a single-column matrix (dimension nX1) containing detection distances at which to evaluate the likelihood. |
covars |
A numeric vector of length q or a
matrix of dimension nXq containing
covariate values
associated with distances in argument |
w.hi |
A numeric scalar containing maximum distance. The right-hand cutoff or upper limit. Ignored by some likelihoods (such as halfnorm, negexp, and hazrate), but is a fixed parameter in other likelihoods (such as oneStep and uniform). |
Rdistance's oneStep likelihood is a mixture of two
non-overlapping uniform distributions. The 'oneStep' density function
is
f(d|p, \theta) = \frac{p}{\theta}I(0 \leq d \leq \theta) +
\frac{1 - p}{w - \theta}I(\theta \le d \leq w),
where I(x) is the indicator function for event x,
and w is the nominal strip width (i.e., w.hi - w.lo in Rdistance).
The unknown parameters to be estimated
are \theta and p
(w is fixed - given by the user).
Covariates influence values of \theta
via a log link function, i.e., \theta = e^{x'b},
where x is the vector of covariate values
associated with distance d, and b
is the vector of estimated coefficients.
A list containing the following two components:
L.unscaled: A matrix of size
nXk
containing likelihood values evaluated at
distances in dist.
Each row is associated with
a single distance, and each column is associated with
a single case (row of a). This matrix is
"unscaled" because the underlying likelihood does
not integrate to one. Values in L.unscaled
are always greater than or equal to zero.
params: A nXkXb array
of the
likelihood's (canonical) parameters in link space (i.e., on
log scale). First page contains
parameter values related to covariates (i.e.,
s = exp(x'a)),
while subsequent pages contain other parameters.
b = 1 for halfnorm, negexp; b = 2 for
hazrate, oneStep, Gamma, and others.
Rows correspond to distances in dist. Columns
correspond to rows from argument a.
Peter F. Craigmile & D.M. Tirrerington (1997) "Parameter estimation for finite mixtures of uniform distributions", Communications in Statistics - Theory and Methods, 26:8, 1981-1995, DOI: 10.1080/03610929708832026
A. Hussein & J. Liu (2009) "Parametric estimation of mixtures of two uniform distributions", Journal of Statistical Computation and Simulation, 79:4, 395-410, DOI:10.1080/00949650701810406
dfuncEstim,
abundEstim,
other <likelihood>.like functions
# Fit oneStep to simulated data
whi <- 250
T <- 100 # true threshold
p <- 0.85
n <- 200
x <- c( runif(n*p, min=0, max=T), runif(n*(1-p), min=T, max=whi))
x <- setUnits(x, "m")
tranID <- sample(rep(1:10, each=n/10), replace=FALSE)
detectDf <- data.frame(transect = tranID, dist = x)
siteDf <- data.frame(transect = 1:10
, length = rep(setUnits(10,"m"), 10))
distDf <- RdistDf(siteDf, detectDf)
# Estimation
fit <- dfuncEstim(distDf
, formula = dist ~ 1
, likelihood = "oneStep"
, w.hi = setUnits(whi, "m")
)
plot(fit)
thetaHat <- exp(coef(fit)[1])
pHat <- coef(fit)[2]
c(thetaHat, pHat) # should be close to c(100,0.85)
summary(abundEstim(fit, ci=NULL))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.