R/compute_gradient_coordinate.R

Defines functions compute_gradient_coordinate

Documented in compute_gradient_coordinate

compute_gradient_coordinate <-
function(coord, theta, fun, step = 1e-6, ...){
	## Finite difference method to compute differential of fun
	## at theta with respect to the coord coordinate
	(fun( add_infinitesimal( theta, coord, c(), step ), ... ) - fun( add_infinitesimal( theta, c(), coord, step ), ... ) )/ (2 * step)
}

Try the pauwels2014 package in your browser

Any scripts or data that you put into this service are public.

pauwels2014 documentation built on May 1, 2019, 6:29 p.m.