# Monte Carlo simulations of correlated stocks by Geometric Brownian motion

I am trying to simulate using a Geometric Brownian Motion process three autocorrelated stocks.

In particular, I need to simulate three different matrices with 1000 scenarios each using a Monte Carlo technique. How could I simulate them in order to be autocorrelated using R Studio?

I saw some posts where it is suggested to use the function mvrnorm() but that it is applied in the generation of a single matrix where the different rows of the matrix are autocorrelated each other. I am looking for a solution where I need to simulate three different matrices that are autocorrelated to each other.

• Thinking “Principal Component Analysis”. you Oct 15 '20 at 21:02
• Hi: You need to explain what you mean by one matrix being correlated to another. I've never heard of such a thing but Ithat doesn't mean that it can't exist. Usually, what are correlated as far as I know are vector RV's or scalar RV's. Oct 15 '20 at 23:01
• what do you mean by matrices? Matrices of what Oct 16 '20 at 23:17
• what do you mean by "three autocorrelated stocks". don't you mean "three correlated stocks"? Oct 17 '20 at 4:24

Let $$n$$ be the number of stocks (here $$n=3$$)

Let $$T$$ be the number of sequential returns to generate (for example $$T=12$$ if you want to generate a year's worth of monthly returns)

Let $$M$$ be the number of alternative scenarios to generate (for example $$M=1000$$ to generate 1000 different outcomes)

Then,

Step 1. You generate a $$n \times T$$ matrix RETS of random correlated returns using mvrnorm()

Step 2. From the RETS you generate a $$n \times T$$ matrix PRICES by assuming an initial price of 100 for each stock and applying the formula prices(i,t)=prices(i,t-1)*(1+rets(i,t))

Step 3. We have generated one set of correlated outcomes. We append the first row of PRICES to PRICE_OUTCOMES_A, the second row to PRICE_OUTCOMES_B and the third row to PRICE_OUTCOMES_C. If these three matrices already have $$M$$ or more rows, we STOP, else we go back to Step 1 to generate another scenario.

At the end the 3 "price outcome matrices" (one matrix for each stock) will be $$M$$ by $$T$$, and each row will have the desired return correlation to the corresponding row of the other matrices.

• price outcome matrices? Oct 16 '20 at 23:17
• Those are the "three different matrices" that the OP requested, each keeping track of price performance of one of the stocks (stock A, stock B, stock C) being simulated. Oct 17 '20 at 9:46
• And the same process could work also for different processes like mean-reverting Vasicek one? Oct 18 '20 at 9:07