MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Cumulative probability that random walk variable

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104876] Re: [mg104834] Cumulative probability that random walk variable
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Thu, 12 Nov 2009 06:04:56 -0500 (EST)
  • References: <200911110928.EAA29352@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

For this, we need a probability density for t itself, not just for x[t].

Assuming the uniform distribution, the problem goes like this:

Clear[xCDF]
xCDF[x_, t_] = CDF[NormalDistribution[0, Sqrt@t], x]

1/2 (1 + Erf[x/(Sqrt[2] Sqrt[t])])

Clear[tPDF]
tPDF[t_] = Boole[0 <= t <= 5]/5

1/5 Boole[0 <= t <= 5]

xCDF[x_] =
  Integrate[tPDF[t] (1 - xCDF[x, t]), {t, 0, 5},
   Assumptions -> {0 < x <= 5}]

(E^(-(x^2/
   10)) (-Sqrt[10] x + 5 E^(x^2/10) Sqrt[\[Pi]] Erfc[x/Sqrt[10]] +
    E^(x^2/10) Sqrt[\[Pi]] x^2 Erfc[x/Sqrt[10]]))/(10 Sqrt[\[Pi]])

Now specifically for x == 2:

xCDF[2]
N@%

(-2 Sqrt[10] + 9 E^(2/5) Sqrt[\[Pi]] Erfc[Sqrt[2/5]])/(10 E^(
  2/5) Sqrt[\[Pi]])

0.0947972

If the distribution of t is complicated, you'll need NIntegrate, rather  
than Integrate.

If the distribution of t is discrete, you'll need Sum.

Bobby

On Wed, 11 Nov 2009 03:28:02 -0600, Kelly Jones  
<kelly.terry.jones at gmail.com> wrote:

> How can I use Mathematica to solve this problem?
>
> Let x[t] be a normally-distributed random variable with mean 0 and
> standard deviation Sqrt[t].
>
> In other words, x[0] is 0, x[1] follows the standard normal
> distribution, x[2] follows the normal distribution with mean 0 and
> standard deviation Sqrt[2], etc.
>
> It's easy to compute the probability that x[5] > 2 (for example).
>
> How do I compute the probability that x[t] > 2 for 0 <= t <= 5.
>
> In other words, the probablity that x[t] surpassed 2 at some point
> between t=0 and t=5, even though x[5] may be less than 2 itself. Notes:
>
>  % My goal: predicting whether a continuous random walk will exceed a
>  given value in a given period of time.
>
>  % I realize that saying things like "x[5] may be less than 2" is
>  sloppy, since x[5] is a distribution, not a value. Hopefully, my
>  meaning is clear.
>
>  % I tried doing this by adding/integrating probabilities like this
>  (psuedo-code):
>
> P(x[t] > 2 for 0 <= t <= 5) = Integral[P(x[t] > 2),{t,0,5}]
>
> but this overcounts if x[t] > 2 for multiple values of t.
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: Re: Mathematica skill level snippet(s)
  • Next by Date: Re: Cylinder cylinder intersection: Design of a starter crank.
  • Previous by thread: Re: Cumulative probability that random walk variable exceeds
  • Next by thread: Re: Cumulative probability that random walk variable