Learn R Programming

windAC (version 1.2.10)

estTWL: Truncated Weighted Likelihood Estimation

Description

Maximum likelihood estimation of a (possibly truncated) probability density function is completed with weights on the likelihood.

Usage

estTWL(fatDist, fatW, distribution, plotBounds = NULL, ...)

weightedLikelihood(fatDist, fatW, distribution, plotBounds = NULL, ...)

Value

Data frame of the parameter estimates for the distribution with fit statistics.

Arguments

fatDist

Vector of fatality distances from the turbine.

fatW

Vector of weights, to weight the likelihood for estimatation. This must be the same length as fatDist and is assumed to be in the same order as fatDist.

distribution

Character indicating the distribution for weightedLikelihood or vector for estTWL.

plotBounds

Vector of length 1 or 2. If the length is 2 (or greater) the max value is used as the upper truncation bound and the min value is used as the lower truncation bound. If the length is 1 this value is taken as the upper truncation bound and zero is set as the lower truncation bound. The default is NULL, in which case the bounds are zero and positive infinity.

...

Additional arguments passed to optim.

Details

The truncated likelihood for a single observation is $$L^*(\theta|x_i) = \frac{f(x_i|\theta)}{\int_{a}^{b}f(y|\theta)dy}$$

Where \(x_i\) is fatDist, \(\theta\) is the vector of parameters to be estimated, a and b correspond to the plotBounds and f() is the distribution chosen.

The truncated weighted likelihood is $$TWL(\theta|\underbar{x}) = \prod_{i=1}^{n}L^*(\theta|x_i)^{w_i}$$ Where n=length(fatDist) and \(w_i\) is fatW.

The truncated weighted likelihood is then estimated using standard maximum likelihood techniques.

See estTWL for examples.

See Also

calcAC

Examples

Run this code
## load the data
data(carcassDistance)
data(proportionAreaSearched)

## add proportion of area searched to each carcass
carcDist <- merge(carcassDistance,proportionAreaSearched,
by=c('plotType','distanceFromTurbine'),all.x=TRUE)

## create the weight for each carcass
carcDist$w <- with(carcDist,1/(proportionAreaSearched*probabilityDetection))

twlOutput <- with(carcDist,estTWL(fatDist=distanceFromTurbine,fatW=w,plotBounds=c(0,100),
distribution=c('norm','weibull','gamma')))

Run the code above in your browser using DataLab