Find local minimum of a 3d distribution

find_local_min_3d(dist, localmin, r, Umax, expand = TRUE, first_called = TRUE)

Arguments

dist

An kde2d distribution object.

localmin

Starting value of finding local minimum.

r

Searching (L1) radius.

Umax

The highest possible value of the potential function.

expand

If the values in the range all equal to Umax, expand the range or not?

first_called

Is this function first called by another function?

Value

A list with two elements: U, the potential value of the local minimum, and location, the position of the local minimum.