I would like to maximize a recursive functional equation but I am struggling with setting up the problem correctly. The equation I am interested in captures the nature of a decision process over time and has the following form:

$$f(l,h,d)=\max_{l\leqslant m\leqslant h}[(1-d)m(\frac{h-m}{h-l})+d^2f(l,m,d)]$$

The first term of the expression to be maximized is the current value of the situation I am trying to represent while the second term is its future value. The code below and the additional information that follows is intended to convey the idea of what I would like to do in some more detail:

f0[l_,h0_,d_] = Maximize[{(1-d)*m1*(h0-m1)/(h0-l)+d^2*f1[l,m1,d], 0<l<=m1<=h0 && 0<d<1}, {m1}]
f1[l_,m1_,d_] = Maximize[{(1-d)*m2*(m1-m2)/(m1-l)+d^2*f2[l,m2,d], 0<l<=m2<=m1 && 0<d<1}, {m2}]
f2[l_,m2_,d_] = Maximize[{(1-d)*m3*(m2-m3)/(m2-l)+d^2*f3[l,m3,d], 0<l<=m3<=m2 && 0<d<1}, {m3}]
f3[l_,m3_,d_] = ...

The function $f_0$ is the original function at time 0, the expression $(h-m)/(h-l)$ is the $cdf$ of a uniform distribution with support $[l,h]$ at time 0, $m_i$ is a choice variable with respect to which the maximization should be done at each iteration step, and $d$ is a discount factor. The function $f_1$ is the next iteration of the process which feeds into the RHS of $f_0$, and so on.

Basically, what should happen during the maximization is that at time $t$ the value for $m_i$ that maximizes the current iteration serves as the upper bound on the distribution at time $t+1$. So, m2 = m1 /. Maximize[{(1-d)*m1*(h0-m1)/(h0-l)+d^2*f1[l,m1,d], 0<l<=m1<=h0 && 0<d<1}, {m1}][[2]]. Over time, therefore, the distribution is increasingly truncated from above.

For sufficiently large intervals, the maximizer $m_i$ will lie in the interior of the range $[l,m_{i+1}]$. As the truncation process continues, however, the relative weight of the discount factor increases until it entirely eats up the benefits of delay. This means that $m_i$ is continuously pushed towards $l$ and that $m_n=l$ for some finite $n$. If we define $f_n(l,l,d)\equiv l/(1+d)$, the equation should have a unique solution and the sequence of optimizations should converge in a finite number of iterations.

What I have not managed is to figure out is how to interlink the individual functions f0, f1, ... in order to actually implement this process.

I am grateful for any help!

  • 1
    $\begingroup$ Can you give us a list of sample parameters to play with? e.g. l, d, h0, etc. $\endgroup$ – march Feb 2 '16 at 16:42
  • $\begingroup$ I usually set l=1, d=0.7 or so and h0 from somewhere in the single digits up to somewhere around 50. $\endgroup$ – m.user Feb 2 '16 at 20:55

Just as a quick an dirty start, I would try this:

$maxStep = 3; (* or what you believe necessary *)
    $eps = 0.001; (* some limit to tell that l and m are now sufficiently close *)

f[l_, m_, d_, $maxStep ] = l / (l + d); (* end by maxStep *)

f[l_, leps_, d_, _ ] /; l <= leps < l + $eps = l / (l + d) (* end by l approx equal m *)

f[l_, h_, d_, n_] /; l < h && 0 < d < 1 && 1 <= n < $maxStep := f[l, h, d, n] = Module[


       (1 - d) * m * (h - m)/(h - l) + d^2 * f[l, m, d, n + 1],

       (* s.t. *) 
       0 < l <= m <= h

f[ 4., 6., 0.1, 1]


| improve this answer | |
  • $\begingroup$ I used MaxValue (and also NMaxValue) but Maximize might work also. Hope that helps. $\endgroup$ – gwr Feb 2 '16 at 17:10
  • $\begingroup$ gwr, this works perfectly, thanks for your help! I greatly appreciate it. $\endgroup$ – m.user Feb 3 '16 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.