Description Usage Arguments Details Value Author(s) See Also Examples
Computes the cosine expansion terms used in the likelihood of a distance analysis. More generally, will compute a cosine expansion of any numeric vector.
1  cosine.expansion(x, expansions)

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, 4, or 5. 
There are, in general, several expansions that can be called cosine. The cosine expansion used here is:
First term:
h1(x) = cos(2*Pi*x),
Second term:
h2(x) = cos(3*Pi*x),
Third term:
h3(x) = cos(4*Pi*x),
Fourth term:
h4(x) = cos(5*Pi*x),
Fifth term:
h5(x) = cos(6*Pi*x),
The maximum number of expansion terms computed is 5.
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
.
Trent McDonald, WEST, Inc. tmcdonald@westinc.com Aidan McDonald, WEST, Inc. aidan@mcdcentral.org
dfuncEstim
, hermite.expansion
, simple.expansion
, and the discussion
of user defined likelihoods in dfuncEstim
.
1 2 3 4  set.seed(33328)
x < rnorm(1000) * 100
x < x[ 0 < x & x < 100 ]
cos.expn < cosine.expansion(x, 5)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.