The correlation coefficient to 0.6.
> D2_Wiener <- function() {+ dev.new(width = 10, height = 4)
+ par(mfrow = c(1, 3), oma = c(0, 0, 2, 0))
+ for(i in 1:3) {
+ W1 <- cumsum(rnorm(100000))
+ W2 <- cumsum(rnorm(100000))
+ plot(W1,W2, type= "l", ylab = "", xlab = "")
+ }}
> mtext("2-dimensional Wiener-processes with no correlation",
+ outer = TRUE, cex = 1.5, line = -1)
> D2_Wiener()
> Correlated_Wiener <- function(cor) {
+ dev.new(width = 10, height = 4)
+ par(mfrow = c(1, 3), oma = c(0, 0, 2, 0))
+ for(i in 1:3) {
+ W1 <- cumsum(rnorm(100000))
+ W2 <- cumsum(rnorm(100000))
+ W3 <- cor * W1 + sqrt(1 - cor^2) * W2
+ plot(W1, W3, type= "l", ylab = "", xlab = "")
+ }}
0 Comments