Fantastic job on the book and notebooks in this repository.
I was working with book-enterprise-ai-edition-2/recipe-10/dynamic-pricing-limited-experimentation.ipynb and saw one minor issue.
I wanted to see what the timesteps looked like if I used a larger value of m (Using 6 price steps max rater than 4).
When I changed m to a higher value, then eventually the logx function attempts to calculate log of a value < 1 which returns a negative number.
This is the current function:
def logx(x, n):
for i in range(0, n):
x = math.log(x) if x>0 else 0
return x
To avoid that, I beleive this line:
x = math.log(x) if x>0 else 0
should be changed to:
x = math.log(x) if x>1 else 0
From section 3.2 (Notations) here: https://dspace.mit.edu/bitstream/handle/1721.1/119156/Pricing_v4_a.pdf?sequence=1&isAllowed=y
"We use log(m)T to represent m iterations of the logarithm, log(log(... log(T))), where m is the number of price changes.
For convenience, we let log(x) = 0 for all 0 ≤ x < 1, so the value of log(m) T is defined for all T ≥ 1."