# Random walk touching or exceeding thresholds

What is the formula to estimate the probability of a random walk touching or exceeding a particular threshold? The threshold starts and stops at particular times. (Without starting and stopping times for the threshold, the probability would of course be 1). I am thinking of a random walk in a time-series.

Secondly, what is the formula to estimate the total probability that after the random walk has touched or exceeded the first threshold, that it will go on to touch or exceed another different threshold, which has other starting and stopping times?

Ideally I am looking for something I can use in a Linux spreadsheet or programming language.

Edit/update: The type of random walk would be Brownian motion in a time series I suppose. The random walk starts at t=0, with an initial magnitude of M1. The first threshold starts at t1 and ends at t2. The (unchanging, constant) magnitude of the threshold is M2. The second threshold has different values to the first threshold.

• The vagueness of phrases like "starts and stops at particular times" and "another different threshold" might make this question difficult or impossible to answer. Could you be more specific about what you mean by this and, indeed, what kind of "random walk" you are talking about? BTW, unless these thresholds are simple to describe, it's unlikely there exist simple or even closed formulas for these probabilities. Also, "the probability would of course be 1" is not necessarily true: when the thresholds are not constant that probability could be less than 1. – whuber Oct 22 '17 at 16:24
• Like @whuber suggests this isn't a simple problem. But, it has been addressed in exactly the form you suggest in the first paragraph by Doob. Look up Doob's upcrossing inequality. The second question you're asking is more difficult, but can be thought of as a particular case of applying Doob's upcrossing inequality multiple times. – David Kozak Dec 9 '17 at 22:23