Skip to contents

Fit GPA or WGPA to landmark data.

Usage

gpa_fit(x, B = 0, ncores = getOption("Ncpus", 1L),
    weighted=FALSE, ...)
# S3 method for gpa_fit
print(x, truncate=40, ...)

Arguments

x

an EDMA data object of class 'edma_data'.

B

nonnegative integer, the number of bootstrap replicates.

weighted

logical, use shapes::procWGPA instead of shapes::procGPA.

ncores

positive integer, the number of cores to use when bootstrapping. Use options(Ncpus = 2) to set it to 2 globally.

truncate

numeric, number of characters to print for the object title.

...

arguments passed to shapes::procGPA or shapes::procWGPA.

Value

Returns only form matrix, SigmaKstar is NA.

References

Gower, J.C. (1975). Generalized Procrustes analysis, Psychometrika, 40, 33--50.

Author

Peter Solymos wrote the wrapper for shapes::procGPA.

Examples

file <- system.file(
    "extdata/crouzon/Crouzon_P0_Global_MUT.xyz",
    package="EDMAinR")
x <- read_xyz(file)
x <- x[,,1:10] # 10 specimens

## nonparametric fit
fit <- gpa_fit(x, B=9)
fit
#> GPA fit (mean form only): Crouzon P0 MUT
#> Call: gpa_fit(x = x, B = 9)
#> 47 landmarks, 3 dimensions, 10 specimens, 9 bootstrap runs
str(Meanform(fit))
#>  num [1:47, 1:3] -0.207 -2.827 0.465 2.453 1.713 ...
#>  - attr(*, "dimnames")=List of 2
#>   ..$ : chr [1:47] "amsph" "bas" "cpsh" "ethma" ...
#>   ..$ : chr [1:3] "X" "Y" "Z"
str(SigmaKstar(fit))
#>  NULL