Learn R Programming

Rdistance (version 4.1.1)

hazrate.like: Hazard rate likelihood

Description

Computes the hazard rate distance function.

Usage

hazrate.like(a, dist, covars, w.hi = NULL)

Value

A list containing the following two components:

  • L.unscaled: A matrix of size nXkXb 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. 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 and others. Rows correspond to distances in dist. Columns correspond to rows from argument a.

Arguments

a

A vector or matrix of covariate and expansion term coefficients. If matrix, dimension is k X p, where k = nrow(a)) is the number of coefficient vectors to evaluate (cases) and p = ncol(a)) is the number of covariate and expansion coefficients in the likelihood (i.e., rows are cases and columns are covariates). If a is a dimensionless vector, it is interpreted as a single row with k = 1. Covariate coefficients in a are the first q values (q <= p), and must be on a log scale.

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 dist.

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, heber, and uniform).

Details

The hazard rate likelihood is $$f(x|\sigma,k) = 1 - \exp(-(x/\sigma)^{-k})$$ where \(\sigma\) determines location (i.e., distance at which the function equals 1 - exp(-1) = 0.632), and \(k\) determines slope of the function at \(\sigma\) (i.e., larger k equals steeper slope at \(\sigma\)). For distance analysis, the valid range for both \(\sigma\) and k is \(\geq 0\).

See Also

dfuncEstim, abundEstim, other <likelihood>.like functions

Examples

Run this code
d <- seq(0, 100, length=100)
covs <- matrix(1,length(d),1)
hazrate.like(c(log(20), 5), d, covs)

# Changing location parameter
plot(d, hazrate.like(c(log(20), 5), d, covs)$L.unscaled, type="l", col="red")
lines(d, hazrate.like(c(log(40), 5), d, covs)$L.unscaled, col="blue")
abline(h = 1 - exp(-1), lty = 2)
abline(v = c(20,40), lty = 2)

# Changing slope parameter
plot(d, hazrate.like(c(log(50), 20), d, covs)$L.unscaled, type="l", col="red")
lines(d, hazrate.like(c(log(50), 2), d, covs)$L.unscaled, col="blue")
abline(h = 1 - exp(-1), lty = 2)
abline(v = 50, lty = 2)

         

Run the code above in your browser using DataLab