Autocorrelated, discrete, bounded and symmetric random walk with no edge attraction

120 Views Asked by At

I need to move over a discrete set of linearly organized.. let's say "Japan steps" $S=\{0,\dots,c\}, c \in \mathbb{N}^*$. My current position is given by $d \in S$.

On each time step, I need to draw a new position $p \in S$. Let's call ${\cal D}(d)$ the distribution over $S$ that I will draw $p$ from, and $f_d : \left\{\begin{array}{l} S \rightarrow [0,1]\\ x \mapsto \mathbb{P}(p=x)\end{array}\right.$ the associated density function.

For any position $d$, I need ${\cal D}(d)$ to respect:

  • $\mathbb{E}(p) = d$ (best expectation is no move)
  • $\forall x \in S,\ \ f_d(x) > 0$ (any step can be reached at any time)
  • $\forall (x,y) \in S,\ |x-d|<|y-d| \Rightarrow f_d(x) > f_d(y)$ (but don't move too far since I need autocorrelation)
  • $\forall d \in S \setminus \{0,c\},\ \sum_{0}^{d-1}{f_d(x)} = \sum_{d+1}^{c}{f_d(x)}$ (symmetry in the motion: no attraction to the edges nor repulsion from them)

And it would just be awesome if we also could have a constant probability $K \in [0,1]$ for "staying here", such that, at least:

$\forall d \in S,\ f_d(d) \approx K$

Is this possible? If yes, what distribution shoud I use?

1

There are 1 best solutions below

0
On BEST ANSWER

Well, I managed to hand-build a dirty distribution that works for me. The idea is to paste two geometric distributions together, and to truncate them not to get out of $S$:

  • give yourself two parameters $k \in [0,\frac{2}{3}]$ (overload for the probability of "staying here") and $\lambda \in \mathbb{R}^+$ (parameter for the geometric distribution).
  • compute this interesting sum $s = \frac{1-\lambda}{\sum_{1}^{c}{(1-\lambda)^i}}$
  • define your constant probability of "staying here" as $K = \min\left(1, k + \max\left(\frac{1}{3},\frac{s}{1-s}\right)\right)$
  • define $f_d$ as:

$\forall d, x \in S, f_d(x) = \left\{\begin{array}{ll} K & \text{if}\ x = d\\ (1-K) - \frac{(1-\lambda)^{|x-d|}}{a\sum_{1}^{u}{(1-\lambda)^i}} & \text{if}\ x \neq d, \text{with}\ a = \left\{\begin{array}{ll}1 & \text{if}\ d \in \{0,c\} \\ 2 & \text{otherwise}\end{array}\right.,\text{and}\ u = \left\{\begin{array}{ll}d & \text{if}\ x < d \\ c-d & \text{if}\ x> d\end{array}\right.\end{array}\right.$

I don't like it since it doesn't look natural, but it does fulfill the above requirement. Here is some Mathematica script for playing around with it:

$f_d$

 m[x_, d_, c_, \[Lambda]_] := (1 - \[Lambda])^Abs[x - d]/(
  If[d == c || d == 0, 1, 
    2] Total[(1 - \[Lambda])^# & /@ Range@If[x > d, c - d, d]]);

f[x_, d_, c_, k_, \[Lambda]_] := With[{
   K = Min[
     k + Max[1/3, 
       With[{S = (1 - \[Lambda])/
          Total[(1 - \[Lambda])^# & /@ Range@c]}, S/(1 + S)]], 1]
   },
  If[x == d, K, (1 - K) m[x, d, c, \[Lambda]]]
  ]

 Manipulate[TableForm[{
   DiscretePlot[
    Evaluate@f[x, d, c, k, \[Lambda]], {x, 0, c}
    , ImageSize -> 350, PlotRange -> {0, height}, 
    Epilog -> {Black, PointSize[Large], Point[{d, 0}]}]
   , With[{res = 
      Flatten@{0, 
        N@Total[Table[
             f[x, d, c, k, \[Lambda]], {x}~Join~# // 
              Evaluate]] & /@ {{0, d - 1}, {d, d}, {d + 1, c}}, 0}}, 
    TableForm[{{
       (* Plot the probabilities of "staying here" (3), 
       "moving left" (2) and "moving right" (4) *)

       DiscretePlot[res[[i]], {i, 1, 5}, PlotStyle -> Red, 
        PlotRange -> {0, 1}],
       (* Check that the distribution sums to 1 *)
       Total[res]
       }}]]
   }],
 {{d, 10}, 0, c, 1},
 {{k, 0}, 0, 2/3},
 {{\[Lambda], .5}, 0, 1},
 {{c, 20}, 1, 50, 1},
 {{height, .5}, 0, 1}]

Any better idea is still welcome :)