Heuristic to integrate (or find all extrema of) a function

65 Views Asked by At

I have a function $f:[0, T] \to [0, 1]$ which is expensive to evaluate and cannot be differentiated numerically. I am interested in computing $$\int_0^Tdt \min\left(\frac{Df}{Dt}(t), 0\right) \,.$$

In general, this seems to be a difficult problem. However, as a physicist, I will be satisfied with an approximation.

$f$ has many local extrema but I have found that there is a timescale $\Delta t \ll T$ such that there is one extremum on an interval of length $\Delta t$. Because of the intensity in computing $f$, it is not practical to evaluate $f$ on the uniform grid $\{k\Delta t | k \in Z\}$. Does there exist a 'good' or optimal approach to determining the integral within some tolerance?

1

There are 1 best solutions below

3
On BEST ANSWER

Define $m_i$ to be the $i$-th local minimum (treating $f(T)$ as a local minimum if $f$ is decreasing at $T$) and $M_j$ to be the $j$-th local maximum (treating $f(0)$ as a local maximum if $f$ is decreasing at $0$). The integral you are attempting to compute is then equal to $$\sum_i^n m_i-\sum_j^N M_j,$$ directly from applying the fundamental theorem of calculus to each monotone segment.

If computing a numeric derivative really is cost prohibitive, I would attempt to estimate the mean values for the local minima and maxima, along with an estimate for their respective counts. Stochastic integration doesn't afford the same guaranteed tolerances of standard techniques, but you can at least have guarantees in the limit assuming some nice distribution of $f$ (analogous to assuming some high-order derivative behaves nicely with classical numeric integration).