Description Usage Arguments Details Value Author(s) See Also Examples
Using numerical integration, this function computes
the area under a distance function between two limits (w.lo
and w.hi
).
1 2  integration.constant(dist, density, a, covars, w.lo, w.hi, series,
expansions, pointSurvey)

dist 
Vector of detection distance values. 
density 
A likelihood function for which the
integration constant is sought. This function
must be capable of evaluating values between

a 
Vector of parameters to pass to 
covars 
Matrix of covariate values. 
w.lo 
The lower limit of integration, or the left truncation value for perpendicular distances. 
w.hi 
The upper limit of integration, or the right truncation value for perpendicular distances. 
series 
The series to use for expansions.
If 
expansions 
Number of expansions in 
pointSurvey 
Boolean. TRUE if point transect data, FALSE if line transect data. 
The trapezoid rule is used to numerically integrate
density
from w.lo
to w.hi
. Twohundred
(200) equalsized trapezoids are used in the integration. The number
of trapezoids to use is fixed and cannot be changed without
rewriting this routine.
A scalar (or vector of scalars if covariates are present)
that is the area under density
between w.lo
and w.hi
.
This scalar can be used as a divisor to scale density such that
it integrates to 1.0. If x = density(...), then
x / integration.constant(density, ...)
will integrate to 1.0.
Trent McDonald, WEST Inc., tmcdonald@westinc.com Aidan McDonald, WEST Inc., aidan@mcdcentral.org Michael Kleinsasser, WEST Inc., mkleinsa@uwyo.edu
1 2 3 4 5 6 7 8 9 10  # Can put any number for first argument (1 used here)
scl < integration.constant(dist=1, density=uniform.like, covars = NULL,
pointSurvey = FALSE, w.lo=0, w.hi = 100,
expansions = 0, a=c(75,25))
print(scl) # Should be 75.1
x < seq(0,100,length=200)
y < uniform.like( c(75,25), x, scale=FALSE ) / scl
int.y < (x[2]x[1]) * sum(y[length(y)]+y[1]) / 2 # the trapezoid rule, should be 1.0
print(int.y) # Should be 1

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.