Optimization is used to find the highest peaks in an area of a function. When we graph out a function, for example, with a function picked randomly with mosaicCalc’s rfun():

h <- rfun(~ x, seed=720)

we can get this graph:

You can see that the highest peak is somewhere on the \(x = {-1}\) area. And the lowest is in near the \(x = {2}\) area. Let’s find where exactly on the graph the peaks really are. We can use mosaicCalc’s argM() function to find the maximum and minimum value of a local domain by force.

argM(h(x) ~ x, bounds(x=-5:5))
## # A tibble: 2 × 3
##        x .output. concavity
##    <dbl>    <dbl>     <dbl>
## 1  2.33     -5.38         1
## 2 -0.777    12.2         -1

Therefore, the maximum value of this function in the domain of \(x = [-5, 5]\) is \({12.2097456}\), and the minimum value would be \({-5.3827119}\).

Reference:

Kaplan, Daniel. 2022. MOSAIC Calculus. GitHub Pages. https://dtkaplan.github.io/MC2/


contra