View source: R/nonparametric.R
edma_fit | R Documentation |
Estimate mean form and SigmaKstar matrix based on Lele (1991), Lele and Richtsmeier (1991) and Hu (2007).
edma_fit(x, B=0, ncores=getOption("Ncpus", 1L))
## generics
Meanform(object, ...)
SigmaKstar(object, ...)
get_fm(object, ...)
## methods
## S3 method for class 'edma_fit_np'
print(x, truncate=40, ...)
## S3 method for class 'edma_fit'
Meanform(object, ...)
## S3 method for class 'edma_fit'
SigmaKstar(object, ...)
## S3 method for class 'edma_fit'
get_fm(object, sort=FALSE, level=0.95, ...)
## S3 method for class 'edma_fit'
confint(object, parm, level=0.95, ...)
## S3 method for class 'edma_fit'
as.edma_data(x, ...)
## plot methods
plot_3d(x, ...)
## S3 method for class 'edma_fit'
plot(x, ...)
## S3 method for class 'edma_fit'
plot_2d(x, ...)
## S3 method for class 'edma_fit'
plot_3d(x, ...)
## S3 method for class 'edma_fit'
plot_ord(x, ...)
## S3 method for class 'edma_fit'
plot_clust(x, ...)
## distance manipulation
## S3 method for class 'edma_fit'
as.dist(m, diag=FALSE, upper=FALSE)
## S3 method for class 'dist'
stack(x, ...)
x, object, m |
an EDMA data object of class 'edma_data'. |
B |
nonnegative integer, the number of bootstrap replicates. |
ncores |
positive integer, the number of cores to use when bootstrapping.
Use |
truncate |
numeric, number of characters to print for the object title. |
sort |
logical, if stacked distances are to be sorted, see Examples. |
level |
numeric, between 0 and 1, alpha level for confidence interval. |
parm |
a specification of which parameters are to be given
confidence intervals, either a vector of numbers or a vector of names.
See |
diag, upper |
logical, indicating whether the diagonal
and the upper triangle of the distance matrix should be printed.
See |
... |
other arguments passed to methods. E.g.
for |
The function estimates mean form and SigmaKstar matrix based on Lele (1991), Lele and Richtsmeier (1991) and Hu (2007).
edma_fit
returns and EDMA fit object of class 'edma_fit'.
.edma_fit_np
is the workhorse function behind edma_fit
.
stack.dist
takes any distance matrix of class 'dist'
and turns that into a long form data frame with
columns row
and col
indicating the row and column
labels, dist
giving the value in that cell.
Only returns the values from the lower triangle of the matrix.
get_fm
is the intended user interface to extract
the form matrix (FM) from EDMA fit objects.
This has the stacked distances based on the mean form.
When the object has bootstrap replicates,
get_fm
also returns confidence intervals
for the distances based on bootstrap and the confint
method.
Meanform
extracts the mean form (K x D) matrix,
SigmaKstar
extracts the corresponding uncertainties
(K x K) based on the EDMA fit object.
plot
and plot_2d
produces a 2D plot of the mean form.
2D projection is used in case of 3D landmark data based on
metric multidimensional scaling.
plot_3d
use the rgl package to make a 3D plot.
The sizes of the dots correspond to
square root of the SigmaKstar diagonal elements.
The plot_ord
and plot_clust
produce plots based on dissimilarities among specimens,
see plot_ord.edma_data
for details.
Peter Solymos, Subhash R. Lele, Theodore M. Cole, Liangyuan Hu, Joan T. Richtsmeier
Lele, S. R., 1991. Some comments on coordinate-free and scale-invariant methods in morphometrics. American Journal of Physical Anthropology 85:407–417. <doi:10.1002/ajpa.1330850405>
Lele, S. R., and Richtsmeier, J. T., 1991. Euclidean distance matrix analysis: A coordinate-free approach for comparing biological shapes using landmark data. American Journal of Physical Anthropology 86(3):415–27. <doi:10.1002/ajpa.1330860307>
Hu, L., 2007. Euclidean Distance Matrix Analysis of Landmarks Data: Estimation of Variance. Thesis, Master of Science in Statistics, Department of Mathematical and Statistical Sciences, University of Alberta, Edmonton, Alberta, Canada. Pp. 49.
EDMA data: read_xyz
Form difference: edma_fdm
Growth difference: edma_gdm
Shape difference: edma_sdm
file <- system.file(
"extdata/crouzon/Crouzon_P0_Global_MUT.xyz",
package="EDMAinR")
x <- read_xyz(file)
x <- x[,,1:10] # 10 specimens
## nonparametric fit
fit <- edma_fit(x, B=9)
fit
str(Meanform(fit))
str(SigmaKstar(fit))
## form matrix
str(as.dist(fit))
str(stack(as.dist(fit)))
head(get_fm(fit))
head(get_fm(fit, sort=TRUE, decreasing=TRUE))
head(get_fm(fit, sort=TRUE, decreasing=FALSE))
plot_ord(fit)
plot_clust(fit)
plot(fit)
plot_2d(fit)
if (interactive())
plot_3d(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.