View source: R/hermite.expansion.R
| hermite.expansion | R Documentation |
Computes Hermite expansion terms for use in distance analysis. The Hermite (and other expansions) allow "wiggle" in estimated distance functions.
hermite.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. |
There are, in general, several expansions that can be called Hermite. Let w = 4x - 2.
Rdistance's Hermite expansions are:
First term:
h_1(w) = w + 2,
Second term:
h_2(w) = w^2 - 4,
Third term:
h_3(w) = w^3 - 3w + 2,
Fourth term:
h_4(w) = w^4 - 6w^2 + 8,
The maximum number of expansion terms computed is 4.
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
, sine.expansion
, simple.expansion.
x <- matrix(seq(0, 1, length = 200), ncol = 1)
herm.expn <- hermite.expansion(x, 4)
plot(range(x), range(herm.expn), type="n")
matlines(x, herm.expn[,1,1:4], col=rainbow(4), lty = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.