Data in either A1 or A2 do not have names. It is assumed data in both A1 and A2 are ordered the same.
Call:
two.b.pls(A1 = GPA1$coords, A2 = GPA2$rotated, print.progress = FALSE)
r-PLS: 1
Effect Size (Z): 3.9295
P-value: 0.001
Based on 1000 random permutations
Although they seem perfectly correlated, you might notice by spinning the plots a slight difference in the scatter. With gpagen, the default is to project configurations into a space tanget to shape space. The procGPA function does not do this. So, gpagen scatter looks more planar and procGPA more hemispherical at each point. We can update this so they are the same.
Note that the function appears to work but is only intended for 2D data, so the results are wacko.
Let’s make this serious (but no plotting because the point fields are too dense!)
# make a latticed cubevert <-10template <-expand.grid(1:vert, 1:vert, 1:vert)colnames(template) <-c("x", "y", "z")# add points for n specimensn <-100LM <- LMlist <-lapply(seq_len(n), function(.){as.matrix(template +rnorm(length(template),mean =0, sd =0.3))})LM <-simplify2array(LM)system.time(GPA1 <-gpagen(LM, print.progress =FALSE, Proj =FALSE))
user system elapsed
0.020 0.004 0.025
system.time(GPA2 <-ProcGPA(LM))
user system elapsed
0.172 0.003 0.176
system.time(GPA3 <-procGPA(LM))
user system elapsed
7.858 0.095 8.091
Updated Conclusion
geomorph is fastermuch faster!
But ProcGPA is pretty fast, as well.
What about sliding semilandmarks?
Let’s pit geomorph::gpagen vs. Morpho::ProcGPA
Let’s also consider long data (many specimens with fewer semilandmarks) and wide data (fewer specimens with many sliding landmarks).
Let’s use minimzed bending energy.
We also need to make sure the functions do the same thing because defaults are different. For these functions, forcing the number of iterations and the number of cores for parallel processing is key.
Simulated Examples for gpagen
Concerning computational efficiency in GPA, there are two “big data” attributes for which to be concerned with geometric morphometric (GM) data: wide data, which is a large number of landmarks (including semilandmarks); and long data, which is a large set of landmark configurations (specimens). These should be studied independently in comparative computational assessments, to determine if attempted optimization of analytical functions is successful only in certain regards. To generate data, we use an automated function, which generates a shape template that is a grid formed along \(x\) and \(y\) axes, with the height of points inversely associated with distance from center, creating a dome-like figure. The fraction of sliding semilandmarks and level of variation for isotropic random points applied to the template can also be varied.
Below is an example template of a dome from a \(32 \times 32\) grid, with 50% of the landmarks as sliders (shown in red), with 20 specimens, created with this function.