d2_central_difference: Numerical approximation of the second derivative

View source: R/d2_central_difference.R

d2_central_differenceR Documentation

Numerical approximation of the second derivative

Description

Calculates the numerical approximation of the second derivative of empirical determinacy measures expressed by Bhattacharyya coefficient (BC) for the given method

Usage

d2_central_difference(desc_vector, method, delta = 0.01)

Arguments

desc_vector

a numeric vector of the means and standard deviations for the base and weighted models with normal posterior distrubutions. This vector has the structure c(mwm, sdwm, mb, sdb, mwp, sdwp), where mwm and sdwm are the mean and the standard deviation from the model with likelihood weighted by a factor of w = 1 - δ, mb and sdb are the mean and standard deviation from the base model and mwp and sdwp are the mean and standard deviation from the model with likelihood weighted by a factor of w = 1 + δ.

method

character string, specifies the type of the distance, which can attain values "H2", "BCL", "BCS".

delta

numeric, numerical differentiation step, for which the weighting factor w = 1 \pm δ. Default value is 0.01

Details

This function approximates the second derivative of the corresponding distance measure by second-order central difference quotient formula.

Value

A numerical value of the numerical approximation of second derivative.


hunansona/ed4bhm documentation built on June 15, 2022, 6:42 p.m.