simple.expansion {Rdistance} | R Documentation |
Calculate simple polynomial expansion for detection function likelihoods
Description
Computes simple polynomial expansion terms used in the likelihood of a distance analysis. More generally, will compute polynomial expansions of any numeric vector.
Usage
simple.expansion(x, expansions)
Arguments
x |
In a distance analysis, |
expansions |
A scalar specifying the number of expansion terms to compute. Must be one of the integers 1, 2, 3, or 4. |
Details
The polynomials computed here are:
-
First term:
h_1(x)=x^4,
-
Second term:
h_2(x)=x^6,
-
Third term:
h_3(x)=x^8,
-
Fourth term:
h_4(x)=x^10,
The maximum number of expansion terms computed is 4.
Value
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
.
See Also
dfuncEstim
, cosine.expansion
, hermite.expansion
, and the discussion
of user defined likelihoods in dfuncEstim
.
Examples
set.seed(883839)
x <- rnorm(1000) * 100
x <- x[ 0 < x & x < 100 ]
simp.expn <- simple.expansion(x, 4)