2

I'm trying to make a point about Markov processes and ran into difficulty understanding how to simulate continuous-time random walks. A discrete-state discrete-time random walk has the equation:

$x_{n+1}=x_n+X_1,\qquad X_1 \in \{-1,1\}$,

while the continuous-state discrete-time random walk could have the equation (of many choices to represent the continuous version of $X_1\in\{-1,1\}$):

$x_{n+1}=x_n+X_2,\qquad X_2 \in [-1,1]$. (Edit to be more clear: a uniform distribution.)

Simulation of the above runs as expected. Now, I'm an engineer, so I'm going to talk about dynamics. When trying to make a continuous-time version of the second equation, I observe that the state changes essentially with a velocity in $[-1,1]$ so the system could be written as

$\dot{x}=X_2, \qquad X_2 \in [-1,1]$. (Edit to be more clear: a uniform distribution)

Note: this is not the "continuous time random walk" which involves jumping at random times. This is an attempted version of the random walk in continuous time.

When I use Euler's method to integrate ($x_{n+1}=x_n+\dot{x}dt$), the result does not match the discrete-time version at all unless dt is 1.

After looking through documentation, I found Wiener's process and, understanding nothing, I asked chatGPT, which told me to use $x_{n+1}=x_n+\dot{x}\cdot\sqrt{dt}$. This violates the possible bounds of state with maximum velocity 1 but in general is the correct scale.

What is going on? What is the proper way to simulate this? (I'm aware that a random walk in continuous-time approaching a slope of 1 is equivalent to flipping an infinite amount of coins and nearly all of them landing on heads. I'm trying to understand what the right way to model this would be.)

I've included four figures. The first one shows the continuous-time process with dt set to 1, which matches the purely discrete version (the blue line is the expected upper bound of slope 1 and the yellow is the expected lower bound of slope -1). Figure 2 shows $x_{n+1}=x_n+\dot{x}\cdot\sqrt{dt}$ (which violates the bounds). Figure 3 shows $x_{n+1}=x_n+\dot{x}dt$, and Figure 4 shows Figure 3 zoomed in so the process and scale can be seen. In this case, dt = 0.00001.

Four figures

Coletti
  • 33

1 Answers1

3

Essentially because the variance scales quadratically, e.g. $\operatorname{Var}(tX) = t^2\operatorname{Var}(X)$.

I'm only going to talk about discrete time processes, rather than something like Brownian motion since you seem mostly interested in that case anyway.

So if you consider time intervals of, say $\Delta$ (in your case, you write $\Delta = dt$), then the process in your post is given as $$ x_t = x_0 + \sum_{i=1}^{ t/\Delta } \Delta X_i $$ where the $X_i$ are i.i.d. random variables with finite variance and zero expectation. Then, $$ \operatorname{Var}(x_t) = \operatorname{Var}\left(x_0 + \sum_{i=1}^{ t/\Delta } X_i\right) = \sum_{i=1}^{ t/\Delta } \operatorname{Var}(\Delta X_i) = \frac{t}{\Delta} \cdot \Delta^2 \operatorname{Var}(X_1) = t\Delta \operatorname{Var}(X_1) $$ so as you send $\Delta \to 0$, you get that $\operatorname{Var}(x_t) \to 0$, and so in the limit, $x_t = E[x_t] = x_0$, which is what you see in your simulations.

It's clear now that if you take steps of $\Delta^p X_i$ for any $p > 0$, the only case where you get variance neither 0 nor $\infty$ is if $p = 1/2$, in which case you get $$ \operatorname{Var}(x_t) = t\operatorname{Var}(X_1). $$

Note that this is independent of the step size, so you should get "the same scale" no matter what size you take $\Delta$ to be.

daisies
  • 2,063
  • 2
  • 7
  • Thank you for your help. I don't have enough reputation to vote for you, unfortunately, but I would if I could!

    I see the issue, how can I correct this variance issue in simulation?

    – Coletti Apr 05 '24 at 19:39
  • If you join the group, then (even with no reputation) you can accept answers to your own questions. – GEdgar Apr 05 '24 at 19:41
  • I mean, the point is that to get a nontrivial process (e.g. one that is finite and not constant) of this form you need to take the scaling on the steps to be proportional to the square root of the step size ($dt$). – daisies Apr 05 '24 at 19:42
  • Oh I think I'm understanding. dt itself needs to change (i.e. the x axis scales?) If not, unfortunately we are left with the original problem that this is a uniform distribution and simulating it in this way violates the maximum constraints of possible states (e.g., the slope exceeds 1 or -1 with a uniform distribution on X1) – Coletti Apr 05 '24 at 19:45
  • If you mean that you want to consider $\int \dot x(t)dt$ where $\dot x(t)$ is pointwise i.i.d. with uniform distribution on $[-1, 1]$, there's a few issues.
    1. The usual setup of probability does not allow uncountably many i.i.d. random variables at once (at least in a nontrivial fashion).
    2. OK well, that's an annoying technical point anyway, but if you get around it you will probably find that you cannot integrate $\dot x$ in a meaningful way insofar as $t \to \dot x(t)$ is not measurable.
    – daisies Apr 05 '24 at 19:52
  • Got it. I think this does answer my question (it's not possible), thank you so much. :) – Coletti Apr 05 '24 at 19:56