fdistmatrix | R Documentation |
Calculate the distance between functional objects over the defined range.
fdistmatrix(fd, subrange, distmethod)
fd |
A functional data object |
subrange |
A vector of two values indicating the value range of functional object to calculate on. |
distmethod |
The method for calculating the distance matrix. Choose
between |
If choosing distmethod = "manual"
, the L2 distance between all pairs of
functions y_i(t)
and y_j(t)
is given by:
d_R(y_i, y_j) = \sqrt{\int_{a_r}^{b_r} [y_i(t) - y_j(t)]^2 dt}.
A distance matrix with diagonal value and the upper half.
library(fda)
# Examples taken from fda::Data2fd()
data(gait)
# Function only works on two dimensional data
gait <- gait[, 1:5, 1]
gaitbasis3 <- create.fourier.basis(nbasis = 5)
gaitfd3 <- Data2fd(gait, basisobj = gaitbasis3)
fdistmatrix(gaitfd3, c(0.2, 0.4), "usc")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.