weightedLikelihood: Truncated Weighted Likelihood Estimation

View source: R/weightedLikelihood.R

estTWLR Documentation

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, ...)

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.

Value

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

See Also

calcAC

Examples

## 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')))


windAC documentation built on March 31, 2023, 9:30 p.m.