expansionTerms - Distance function expansion terms
expansionTerms - Distance function expansion terms
Compute "expansion" terms that modify the shape of a base distance function.
expansionTerms(a, d, series, nexp, w)
Arguments
a: A vector or matrix of (estimated) coefficients. a has length p + nexp (if a vector) or dimension (k, p + nexp), where p is the number of canonical parameters in the likelihood and k is the number of coefficient vectors to evaluate. The first p
elements of a, or the first p columns if a
is a matrix, are ignored. I.e., Expansion term coefficients are the last nexp elements or columns of a.
d: A vector or 1-column matrix of distances at which to evaluate the expansion terms. d should be distances above w.lo, i.e., distances - w.lo. Parameters d and w
must have compatible measurement units.
series: If expansions > 0, this string specifies the type of expansion to use. Valid values at present are 'simple', 'hermite', and 'cosine'.
nexp: Number of expansion terms. Integer from 0 to 5.
w: Strip width, i.e., w.hi - w.low = range of d. Parameters d and w must have compatible measurement units.
Returns
If nexp equals 0, 1 is returned. If nexp is greater than 0, a matrix of size nXk containing expansion terms, where n = length(d) and k = nrow(a). The expansion series associated with row j of a
are in column j of the return. i.e., element (i,j) of the return is
Expansion terms modify the "key" function of the likelihood manipulatively. The modified distance function is, key * expTerms where key is a vector of values in the base likelihood function (e.g., halfnorm.like()$L.unscaled
or hazrate.like()$L.unscaled) and expTerms is the matrix returned by this routine.
Let the number of expansions (nexp) be m (m > 0), assume the raw cyclic expansion terms of series
are hj(x) for the j−th expansion of distance x, and that a(1),a(2),...,a(m) are (estimated) coefficients for the expansion terms, then the likelihood contribution for the i−th distance x(i) is,