Rdistance (version 1.3.2)

cosine.expansion: Calcululation of cosine expansion for detection function likelihoods.

Description

Computes the cosine expansion terms used in the likelihood of a distance analysis. More generally, will compute a cosine expansion of any numeric vector.

Usage

cosine.expansion(x, expansions)

Arguments

x

In a distance analysis, x is a numeric vector of the proportion of a strip transect's half-width at which a group of individuals were sighted. If w is the strip transect half-width or maximum sighting distance, and d is the perpendicular off-transect distance to a sighted group (dw), x is usually d/w. More generally, x is a vector of numeric values

expansions

A scaler specifying the number of expansion terms to compute. Must be one of the integers 1, 2, 3, 4, or 5.

Value

A matrix of size length(x) X expansions. The columns of this matrix are the cosine expansions of x. Column 1 is the first expansion term of x, column 2 is the second expansion term of x, and so on up to expansions.

Details

There are, in general, several expansions that can be called cosine. The cosine expansion used here is:

  • First term: h1(x)=cos(2πx),

  • Second term: h2(x)=cos(3πx),

  • Third term: h3(x)=cos(4πx),

  • Fourth term: h4(x)=cos(5πx),

  • Fifth term: h5(x)=cos(6πx),

The maximum number of expansion terms computed is 5.

See Also

F.dfunc.estim, hermite.expansion, simple.expansion, and the discussion of user defined likelihoods in F.dfunc.estim.

Examples

Run this code
# NOT RUN {
set.seed(33328)
x <- rnorm(1000) * 100
x <- x[ 0 < x & x < 100 ]
cos.expn <- cosine.expansion( x, 5 )
# }

Run the code above in your browser using DataLab