Taking a further step from my previous post, in this one, we are going to see the application of the Golden-section Search to a density function. If you are not quite familiar with the method yet, you might want to refer first here.
Motivational Problem
Suppose we have a function KaTeX can only parse string typed expression
f:[L,R]→[0,∞) satisfying
KaTeX can only parse string typed expression
∫LRf(x)dx=1
, which shows the spread of local minimum/maximum of a function KaTeX can only parse string typed expression
g:[L,R]→R that is unimodal. Denote KaTeX can only parse string typed expression
m as the minimum/maximum peak point of KaTeX can only parse string typed expression
g, we aim to find a point KaTeX can only parse string typed expression
p such that
KaTeX can only parse string typed expression
∫p−δp+δf(x)dx≤ϵ s.t. ∣m−p∣≤δ
, where KaTeX can only parse string typed expression
ϵ represents an acceptable error and KaTeX can only parse string typed expression
ϵ<1. We achieve this by only querying the value of the function at specific points, i.e., evaluating KaTeX can only parse string typed expression
f(x) for chosen values of KaTeX can only parse string typed expression
x in the interval KaTeX can only parse string typed expression
[L,R], as efficiently as possible.
Golden-section Search Method
In the previous post, we have shown that in the Golden-section Search method, we usually want to have our pivot points to be located in both KaTeX can only parse string typed expression
L+(1−ϕ1)(R−L) and KaTeX can only parse string typed expression
R−(1−ϕ1)(R−L). However, we notice that the number of queries depends on the value of KaTeX can only parse string typed expression
L and KaTeX can only parse string typed expression
R; consequently, when the range between KaTeX can only parse string typed expression
L and KaTeX can only parse string typed expression
R is big enough (say they are approaching KaTeX can only parse string typed expression
−∞ and KaTeX can only parse string typed expression
∞), the number of queries used will also become bigger. That being said, performing a search based on function KaTeX can only parse string typed expression
g will not be reliable.
To make up for this, we need to make an adjustment for which interval we are going to query as our base. By using prior knowledge about the statistical method, we can focus our search on where the minimum / maximum is more likely to be found. Hence, we want to perform our search based on function KaTeX can only parse string typed expression
f. For the pivots that we needed, we want to set KaTeX can only parse string typed expression
p1 and KaTeX can only parse string typed expression
p2 as values that satisfy
KaTeX can only parse string typed expression
∫Lp1f(x)dx=∫LLf(x)dx+(1−ϕ1)∫LRf(x)dx=(1−ϕ1)∫LRf(x)dx
and
KaTeX can only parse string typed expression
∫Lp2f(x)dx=∫LRf(x)dx−(1−ϕ1)∫LRf(x)dx=ϕ1∫LRf(x)dx
Figure 1
Figure 2
This works well as after each transition; we manage to remove either KaTeX can only parse string typed expression
[L,p1] or KaTeX can only parse string typed expression
[p2,R] from our search space. Although, in a sense, it is quite hard to calculate the number of queries needed as KaTeX can only parse string typed expression
p1 and KaTeX can only parse string typed expression
p2 do not entirely depends on both KaTeX can only parse string typed expression
L and KaTeX can only parse string typed expression
R, but also KaTeX can only parse string typed expression
f. However, notice that we can always choose KaTeX can only parse string typed expression
p=2L+R and KaTeX can only parse string typed expression
δ=2R−L in any valid interval that subject to KaTeX can only parse string typed expression
∣m−p∣≤δ. Denote KaTeX can only parse string typed expression
k as KaTeX can only parse string typed expression
∫p−δp+δf(x)dx, let's analyze the two cases:
-
Case KaTeX can only parse string typed expression
[L,p1] is removed from the interval KaTeX can only parse string typed expression
[L,R]:
KaTeX can only parse string typed expression
pδk:=2p1+R:=2R−p1:=∫p1Rf(x)dx=∫LRf(x)dx−∫Lp1f(x)dx=ϕ1∫LRf(x)dx
-
Case KaTeX can only parse string typed expression
[p2,R] is removed from the interval KaTeX can only parse string typed expression
[L,R]:
KaTeX can only parse string typed expression
pδk:=2L+p2:=2p2−L:=∫Lp2f(x)dx=ϕ1∫LRf(x)dx
Each query allows us to reduce KaTeX can only parse string typed expression
k to KaTeX can only parse string typed expression
ϕ1k; denote KaTeX can only parse string typed expression
Q as the number of queries needed, then:
KaTeX can only parse string typed expression
Q=3+⌈logϕ(ϵ1)⌉
Additional Variation: Density Function
When encountering a similar function, say KaTeX can only parse string typed expression
f, that does not satisfy the KaTeX can only parse string typed expression
∫−∞∞f(x)dx=1 condition, but still represents the spread of the peak point in a unimodal function, we can make a transformation to accommodate this scenario. We will transform the function KaTeX can only parse string typed expression
f(x) into KaTeX can only parse string typed expression
f′(x) and KaTeX can only parse string typed expression
ϵ into KaTeX can only parse string typed expression
ϵ′, where:
KaTeX can only parse string typed expression
f′(x)=∫−∞∞f(x)dx1 f(x)
and
KaTeX can only parse string typed expression
ϵ′=∫−∞∞f(x)dx1ϵ,ϵ<∫−∞∞f(x)dx
. And there we have it! If prior knowledge about the function's behavior or specific features of the local minima/maxima is known, we can always customize the search strategy accordingly. This could involve using different weighting schemes or adapting the pivots.
© 2023 Yohandi. All rights reserved.