hermite.expansion function

Calculation of Hermite expansion for detection function likelihoods

Calculation of Hermite expansion for detection function likelihoods

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

hermite.expansion(x, expansions)

Arguments

  • x: In a distance analysis, x is a numeric vector containing the proportion of a strip transect's half-width at which a group of individuals was sighted. If ww is the strip transect half-width or maximum sighting distance, and dd is the perpendicular off-transect distance to a sighted group (d<=wd <= w), x is usually d/wd/w. More generally, x

    is a vector of numeric values.

  • expansions: A scalar specifying the number of expansion terms to compute. Must be one of the integers 1, 2, 3, or 4.

Returns

A matrix of size length(x) X expansions. The columns of this matrix are the Hermite polynomial 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 Hermite. The Hermite expansion used here is:

  • First term :
h1(x)=x46x2+3,h1(x)=x46(x)2+3, h_1(x)=x^4 - 6x^2 + 3,h1(x) = x^4 - 6*(x)^2 +3,
  • Second term :
h2(x)=x615x4+45x215,h2(x)=(x)615(x)4+45(x)215, h_2(x)=x^6 - 15x^4 + 45x^2 - 15,h2(x) = (x)^6 - 15*(x)^4 + 45*(x)^2 - 15,
  • Third term :
h3(x)=x828x6+210x4420x2+105,h3(x)=(x)828(x)6+210(x)4420(x)2+105, h_3(x)=x^8 - 28x^6 + 210x^4 - 420x^2 + 105,h3(x) = (x)^8 - 28*(x)^6 + 210*(x)^4 - 420*(x)^2 + 105,
  • Fourth term :
h4(x)=x1045x8+630x63150x4+4725x2945,h4(x)=(x)1045(x)8+630(x)63150(x)4+4725(x)2945, h_4(x)=x^10 - 45x^8 + 630x^6 - 3150x^4 + 4725x^2 - 945,h4(x) = (x)^10 - 45*(x)^8 + 630*(x)^6 - 3150*(x)^4 + 4725*(x)^2 - 945,

The maximum number of expansion terms computed is 4.

Examples

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

See Also

dfuncEstim, cosine.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