predictRelWarps: predict relative warps for data not included in the training...

View source: R/relwarps.r

predictRelWarpsR Documentation

predict relative warps for data not included in the training data set

Description

predict relative warps for data not included in the training data set

Usage

predictRelWarps(x, newdata, noalign = FALSE)

Arguments

x

output from relWarps

newdata

k x m x n array holding new landmark data

noalign

logical: if TRUE, data is assumed to be already aligned to training data and alignment is skipped.

Details

This function aligns the new data to the mean from x and transforms it into the relative warp space computed from the training data.

Value

returns a list containing

bescores

relative warp scores (PC-scores if alpha = 0)

uniscores

uniform scores, NULL if alpha = 0

Examples

data(boneData)
set.seed(42)
training <- sample(1:80,size=60)
rW1 <- relWarps(boneLM[,,training], alpha = -1)
## predict scores for the entire sample
predAll <- predictRelWarps(rW1,boneLM)

## now compare the scores predicted scores to the original ones
layout(matrix(1:4,2,2))
for (i in 1:2) {
  plot(rW1$bescores[,i],predAll$bescores[training,i],main=paste("RW",i))
  plot(rW1$uniscores[,i],predAll$uniscores[training,i],main=paste("UC",i))
}

Morpho documentation built on June 22, 2024, 7:19 p.m.