View source: R/sine.expansion.R
| sine.expansion | R Documentation |
Computes the sine expansion terms that modify the shape of distance likelihood functions.
sine.expansion(x, expansions)
x |
A numeric matrix of distances at which to evaluate
the expansion series. For distance analysis, |
expansions |
A scalar specifying the number of expansion terms to compute. Must be one of the integers 1, 2, 3, 4, or 5. |
The sine expansion used here is:
First term:
h_1(x)=\sin(2\pi x)/2,
Second term:
h_2(x)=\sin(3\pi x)/2,
Third term:
h_3(x)=\sin(4\pi x)/2,
Fourth term:
h_4(x)=\sin(5\pi x)/2,
Fifth term:
h_5(x)=\sin(6\pi x)/2,
The maximum number of expansion terms is 5.
The sine expansion frequency in Rdistance is pi. Each term is one pi more than the previous. The cosine expansion frequency in Rdistance is 2*pi. Consequently, the sine and cosine expansions fit different models.
A 3D array of size nrow(x) X ncol(x) X expansions.
The 'pages' (3rd dimension) of this array are the cosine expansions of
x. i.e., page 1 is the first expansion term of x,
page 2 is the second expansion term of x, etc.
dfuncEstim,
cosine.expansion
x <- matrix(seq(0, 1, length = 200), ncol = 1)
sin.expn <- sine.expansion(x, 5)
plot(range(x), range(sin.expn), type="n")
matlines(x, sin.expn[,1,1:5], col=rainbow(5), lty = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.