rmse: Calculate the root mean square (RMSE) and landmark distances...

View source: R/rmse.R

rmseR Documentation

Calculate the root mean square (RMSE) and landmark distances for a specimen (a landmark matrix/array)

Description

This function calculates the root mean square (RMSE) and landmark distances for a specimen (a landmark matrix/array) to a reference specimen (e.g., a mean shape or a manually landmarked specimen)

Usage

rmse(M1, M2)

Arguments

M1

A matrix or 2d array storing landmark coordinates of a specimen

M2

A matrix or 2d array storing landmark coordinates of a reference specimen

Value

A list that contains the RMSE of the specimen as well as pairwise landmark distances
between the specimen and the reference
The returned value contains:

  • $LM_distances = all pairwise landmark distances between a specimen and a reference

  • $RMSE = the RMSE value between a specimen and a reference

Examples

create two 3D LM coordinates:
x=NULL
for (i in 1:5) x=rbind(x, c(0,0,i))
x
[,1] [,2] [,3]
[1,]    0    0    1
[2,]    0    0    2
[3,]    0    0    3
[4,]    0    0    4
[5,]    0    0    5
y=NULL
for (i in 5:1) y=rbind(y, c(0,0,i))
rmse(x,y)
$LM_distances
[1] 4 2 0 2 4
$RMSE
[1] 2.828427

chz31/SlicerMorphR documentation built on Feb. 10, 2023, 11:56 p.m.