competingPoints: select the most probable points based on a statistical model

Description Usage Arguments Value Examples

Description

select the most probable points based on a statistical model, using the mahalanobisdistance

Usage

1
2
3
4
5
competingPoints(model, sample, index, mahalanobis = TRUE)

## S4 method for signature 'pPCA,matrix,numeric'
competingPoints(model, sample, index,
  mahalanobis = TRUE)

Arguments

model

statistical shape model of class 'pPCA'

sample

k x 3 matrix of coordinates

index

integer vector of lenght k assigning the corresponding index of the model's coordinates to each row of sample

mahalanobis

logical: if FALSE, Euclideandistance is used.

Value

mahadistance

vector containing the mahalanobisdistances of all tested coordinates

goodverts

the coordinates with the lowest mahalanobisdistance

goodrows

integer vector containing the rows of sample that are selected

mahagood

mahalanobisdistances of the probable coordinates only

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
require(Morpho)
     data(boneData)
    align <- rigidAlign(boneLM)$rotated
    mymod <- statismoBuildModel(align,representer=align[,,1],sigma=2,scale=TRUE)
#add some arbitrary data
myconfused <- matrix(rnorm(300),100,3)
myconfusedind <- sample(1:10,size=100,replace=TRUE)
perturb <- sample(1:110)
out <- competingPoints(mymod,rbind(align[,,1],myconfused)[perturb,],c(1:10,myconfusedind)[perturb])
##check if the selected coords are identical to the actual ones
all.equal(align[,,1],out$goodverts)

zarquon42b/RvtkStatismo documentation built on May 4, 2019, 9:09 p.m.