Closed rbalexan closed 4 years ago
Hmm... Actually, shouldn't it be $ \left[ x^{(i)} - \frac{1}{\ell}(y^{(i)}-y{min}), x^{(i)} + \frac{1}{\ell}(y^{(i)}-y{min}) \right] $
The notation is a little tricky here. I think it may be as I wrote it. The algorithm uses index i
as the index of the arg-min of all the sampled function values ($y{min}$ in the equation) and then uses index j
to represent the indices of all the sawtooth valleys ($y^{(i)}$ from the equation). In the algorithm, we test that the y[j] < y[i]
, which is equivalent to $y^{(i)} < y{min}$ in the statement below the equation. Since dy = y[i] - y[j]
this is guaranteed to be positive and equivalently, the $y_{min}-y^{(i)}$ term is positive as well.
Might be worth updating the code or the equation to use similar indexing schemes for clarity. Maybe create a new variable y_min
in the code and switch the loop index to i
?
Ah, yes! You're exactly right. The equation you gave is completely correct. We'll fix this in eq. 3.14 in the next printing.
I'll let @tawheeler comment on the algorithm.
@mykel please don't close issues you still want me to comment on :P
We can certainly change i
to be y_min
, allowing us to replace j
with i
.
Oops, I should have committed with refs, not fixes. Thanks!
Done!
I have the second printing. In the upper bound in Equation 3.14, and with respect to how the lower bound is computed, the leading sign is flipped, but the y_min and y^(i) terms inside the parentheses have also been flipped in sign, so the lower and upper bounds appear to be equal.
Based on the algorithm, I think it should be: $ \left[ x^{(i)} - \frac{1}{\ell}(y{min}-y^{(i)}), x^{(i)} + \frac{1}{\ell}(y{min}-y^{(i)}) \right] $