calibrate_harmonicpower: Quantitative calibration, through harmonic power, for Out and...

Description Usage Arguments Details Value See Also Examples

View source: R/core-calibrate.R

Description

Estimates the number of harmonics required for the four Fourier methods implemented in Momocs: elliptical Fourier analysis (see efourier), radii variation analysis (see rfourier) and tangent angle analysis (see tfourier) and discrete Fourier transform (see dfourier). It returns and can plot cumulated harmonic power whether dropping the first harmonic or not, and based and the maximum possible number of harmonics on the Coo object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
calibrate_harmonicpower()

calibrate_harmonicpower_efourier(x, id = 1:length(x), nb.h, drop = 1,
  thresh = c(90, 95, 99, 99.9), plot = TRUE)

calibrate_harmonicpower_rfourier(x, id = 1:length(x), nb.h, drop = 1,
  thresh = c(90, 95, 99, 99.9), plot = TRUE)

calibrate_harmonicpower_tfourier(x, id = 1:length(x), nb.h, drop = 1,
  thresh = c(90, 95, 99, 99.9), plot = TRUE)

calibrate_harmonicpower_sfourier(x, id = 1:length(x), nb.h, drop = 1,
  thresh = c(90, 95, 99, 99.9), plot = TRUE)

calibrate_harmonicpower_dfourier(x, id = 1:length(x), nb.h, drop = 1,
  thresh = c(90, 95, 99, 99.9), plot = TRUE)

Arguments

x

a Coo of Opn object

id

the shapes on which to perform calibrate_harmonicpower. All of them by default

nb.h

numeric the maximum number of harmonic, on which to base the cumsum

drop

numeric the number of harmonics to drop for the cumulative sum

thresh

vector of numeric for drawing horizontal lines, and also used for minh below

plot

logical whether to plot the result or simply return the matrix Silent message and progress bars (if any) with options("verbose"=FALSE).

Details

The power of a given harmonic n is calculated as follows for elliptical Fourier analysis and the n-th harmonic: HarmonicPower_n \frac{A^2_n+B^2_n+C^2_n+D^2_n}{2} and as follows for radii variation and tangent angle: HarmonicPower_n= \frac{A^2_n+B^2_n+C^2_n+D^2_n}{2}

Value

returns a list with component:

See Also

Other calibration: calibrate_deviations, calibrate_r2, calibrate_reconstructions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
b5 <- bot %>% slice(1:5)
b5  %>% calibrate_harmonicpower_efourier(nb.h=12)
b5  %>% calibrate_harmonicpower_rfourier(nb.h=12)
b5  %>% calibrate_harmonicpower_tfourier(nb.h=12)
b5  %>% calibrate_harmonicpower_sfourier(nb.h=12)

# on Opn
olea %>% slice(1:5) %>%
    calibrate_harmonicpower_dfourier(nb.h=12)
## Not run: 
# let customize the ggplot
library(ggplot2)
cal <- b5  %>% calibrate_harmonicpower_efourier(nb.h=12)
cal$gg + theme_minimal() +
coord_cartesian(xlim=c(3.5, 12.5), ylim=c(90, 100)) +
ggtitle("Harmonic power calibration")

## End(Not run)

Momocs documentation built on March 23, 2018, 1:04 a.m.