Description Usage Arguments Value Examples
select the most probable points based on a statistical model, using the mahalanobisdistance
1 2 3 4 5 | competingPoints(model, sample, index, mahalanobis = TRUE)
## S4 method for signature 'pPCA,matrix,numeric'
competingPoints(model, sample, index,
mahalanobis = TRUE)
|
model |
statistical shape model of class 'pPCA' |
sample |
k x 3 matrix of coordinates |
index |
integer vector of lenght |
mahalanobis |
logical: if FALSE, Euclideandistance is used. |
mahadistance |
vector containing the mahalanobisdistances of all tested coordinates |
goodverts |
the coordinates with the lowest mahalanobisdistance |
goodrows |
integer vector containing the rows of |
mahagood |
mahalanobisdistances of the probable coordinates only |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.