
This function computes a measure of discord for a sample of random rotations. The larger the statistic value the less likely it is the corresponding observation was generated by the same mechanism the rest of the data as generated by. It can be used to test for outliers in SO(3) by comparing it to an F distribution with 3,3(n-2) df for the Cayley or matrix Fisher distributions or to an F distribution with 1,n-2 df for the von Mises Fisher distribution.
discord(x, type, t = 1L, obs = 1:nrow(x))
The Hi statistic for each group of size t is returned. If t>1
then which observations
that define each group of size t
is returned as well.
The sample of random rotations
To specify if "intrinsic" or "extrinsic" approach should be used to compute the statistic
If test blocs then the bloc size, set to 1 by default
integer vector specifying which observation(s) to compute the measure of discord for
#Compute the measures of discord for a sample from the Cayley distribution
# Intrinsic examples are commented out but are below if you're interested
Rss <- ruars(20,rcayley,kappa=1)
Hi <- discord(Rss, type='intrinsic')
He <- discord(Rss, type='extrinsic')
#Compare to the theoretical F distribution
OrdHi <- sort(Hi)
OrdHe <- sort(He)
par(mfrow=c(1,2))
plot(ecdf(OrdHi),main='Intrinsic',xlim=range(c(OrdHi,OrdHe)))
lines(OrdHi,pf(OrdHi,3,3*(length(OrdHi)-2)))
plot(ecdf(OrdHe),main='Extrinsic',xlim=range(c(OrdHi,OrdHe)))
lines(OrdHi,pf(OrdHi,3,3*(length(OrdHe)-2)))
layout(1)
Run the code above in your browser using DataLab