Skip to contents

Inverts the monotone curves of calibrate_shape() by linear interpolation. Where a curve is flat (tied values of its monotone fit), the parameter is the mean of the tied values.

Usage

shape_params(calibration, gamma, colless)

Arguments

calibration

Output of calibrate_shape().

gamma, colless

Target mean gamma statistic and normalized Colless index (see tree_shape()); vectors that are recycled to a common length, as in data.frame().

Value

A data frame with the targets and the corresponding beta and c.

Examples

set.seed(1)
cal <- calibrate_shape(50, reps = 50)
shape_params(cal, gamma = c(0, -2), colless = 0.5)
#>   gamma colless       beta           c
#> 1     0     0.5 -0.4020784  0.02818277
#> 2    -2     0.5 -0.4020784 -0.50284776