Simulating a Brownian Excursion Process using Software I would like to simulate a Brownian excursion process using a computer. I want to create sample paths of a Brownian excursion (a Brownian excursion is a Brownian bridge conditioned to be positive at all t between 0 and 1). Is there an easy was for me to do this, maybe in R or Matlab? 
 A: Since a Brownian motion is just continuous stepping from a normal distribution, we can use the cumsum and rnorm functions in R to approximate it. Here is an example of t=500:
Bt <- rnorm(500, 0, 1)
Bt <- cumsum(Bt)

However, since you want your values to always be between 0 and 1, you must add a conditional in between these two steps to eliminate all Bt that are outside of your range:
Bt <- rnorm(500, 0, 1)
Bt <- Bt[Bt > 0 & Bt < 1]
Bt <- cumsum(Bt)

Note that this will not get you 500 total since some of the results will be taken out. Also, I think your definition of Brownian excursion may be slightly incorrect, I thought every step had to be positive (not upper bounded by 1), starting at 0 at time 1.
Here is updated code to implement the Brownian Bridge with it (for 500 steps), I misread the question originally. The main addition is creating a time-series object:
  Bt <- rnorm(500, 0, 1/sqrt(500))
  Bt <- cumsum(Bt)
  Bt <- ts(Bt, start = 1/500, frequency = 500)
  ts(abs(Bt - time(Bt) * as.vector(Bt)[500]), start = 1/500, 
     frequency = 500)

