标签:img http process paste ext pre sse proc type
1. Two-dimensional Wiener Process
dS1 = r·S1·dt + σ1·S1·dW1 ; and dS2 = r·S2·dt + σ2·S2·dW2
Solutions:
St = S0·exp[(r - σ2 /2 )·t + σ·Wt]
1.1 No Correlated
D2_Wiener <- function() { dev.new(width = 10, height = 4) par(mfrow = c(1, 3), oma = c(0, 0, 2, 0)) # bottom, l, top, r for (i in 1:3) { W1 <- cumsum(rnorm(500)) W2 <- cumsum(rnorm(500)) plot(W1, W2, type = ‘l‘, ylab = ‘‘, xlab = ‘‘) } mtext(‘2-dimensional Wiener Processes with No Correlation‘, outer = T, cex = 1.5, line = -1) } D2_Wiener()
1.2 Correlated
D2_CorrWiener <- 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(500)) W2 <- cumsum(rnorm(500)) W3 <- cor * W1 + sqrt(1 - cor^2) * W2 plot(W1, W3, type = ‘l‘, ylab = ‘‘, xlab = ‘‘) } mtext(paste(‘2-dimensional Wiener Processes (‘, cor, ‘correlation)‘, sep = ‘‘), outer = T, cex = 1.5, line = -1) } D2_CorrWiener(0.75)
2. Quanto Options (Quantity Adjusting Option) (using Margrabe formula) (需要修正)
Margrabe <- function(S1, S2, sigma1, sigma2, Time, rho, delta1 = 0, delta2 = 0) { sigma <-sqrt(sigma1 ^ 2 + sigma2 ^ 2 - 2 * sigma1 * sigma2 * rho) d1 <- (log(S1 / S2) + (delta2 - delta1 + sigma ^ 2 / 2) * Time) / (sigma * sqrt(Time)) d2 <- (log(S1 / S2) + (delta2 - delta1 + sigma ^ 2 / 2) * Time) / (sigma * sqrt(Time)) M <- S1 * exp(-delta1 * Time) * pnorm(d1) - S2 * exp(-delta2 * Time) * pnorm(d2) return(M) }
Derivative Pricing_3_Dynamic (two stochastic bg)
标签:img http process paste ext pre sse proc type
原文地址:https://www.cnblogs.com/sophhhie/p/12529121.html