1
$\begingroup$

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.

Thanks in advance for your help!

$\endgroup$
4
  • $\begingroup$ Thinking “Principal Component Analysis”. you $\endgroup$ – demully Oct 15 '20 at 21:02
  • 1
    $\begingroup$ 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. $\endgroup$ – mark leeds Oct 15 '20 at 23:01
  • $\begingroup$ what do you mean by matrices? Matrices of what $\endgroup$ – develarist Oct 16 '20 at 23:17
  • $\begingroup$ what do you mean by "three autocorrelated stocks". don't you mean "three correlated stocks"? $\endgroup$ – develarist Oct 17 '20 at 4:24
2
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ price outcome matrices? $\endgroup$ – develarist Oct 16 '20 at 23:17
  • $\begingroup$ 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. $\endgroup$ – noob2 Oct 17 '20 at 9:46
  • $\begingroup$ And the same process could work also for different processes like mean-reverting Vasicek one? $\endgroup$ – Mark Marconi Oct 18 '20 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.