cosine.expansion function

cosine.expansion - Cosine expansion terms

cosine.expansion - Cosine expansion terms

Computes the cosine expansion terms used to modify the shape of distance likelihood functions.

cosine.expansion(x, expansions)

Arguments

  • x: A numeric vector of distances at which to evaluate the expansion series. For distance analysis, x is of the proportion of a strip transect's half-width at which a group of individuals were sighted, i.e., d/wd/w.
  • expansions: A scalar specifying the number of expansion terms to compute. Must be one of the integers 1, 2, 3, 4, or 5.

Returns

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),h1(x)=cos(2Pix), h_1(x)=\cos(2\pi x),h1(x) = cos(2*Pi*x),
  • Second term :
h2(x)=cos(3πx),h2(x)=cos(3Pix), h_2(x)=\cos(3\pi x),h2(x) = cos(3*Pi*x),
  • Third term :
h3(x)=cos(4πx),h3(x)=cos(4Pix), h_3(x)=\cos(4\pi x),h3(x) = cos(4*Pi*x),
  • Fourth term :
h4(x)=cos(5πx),h4(x)=cos(5Pix), h_4(x)=\cos(5\pi x),h4(x) = cos(5*Pi*x),
  • Fifth term :
h5(x)=cos(6πx),h5(x)=cos(6Pix), h_5(x)=\cos(6\pi x),h5(x) = cos(6*Pi*x),

The maximum number of expansion terms computed is 5.

Examples

x <- seq(0, 1, length = 200) cos.expn <- cosine.expansion(x, 5) plot(range(x), range(cos.expn), type="n") matlines(x, cos.expn, col=rainbow(5), lty = 1)

See Also

dfuncEstim, hermite.expansion, simple.expansion, and the discussion of user defined likelihoods in dfuncEstim.

  • Maintainer: Trent McDonald
  • License: GNU General Public License
  • Last published: 2025-04-10