码迷,mamicode.com
首页 > 其他好文 > 详细

Derivative Pricing_2_Vasicek

时间:2020-02-09 10:04:26      阅读:72      评论:0      收藏:0      [点我收藏+]

标签:euler   sam   mic   type   comm   zed   mat   rom   run   

*Catalog

1. Plotting Vasicek Trajectories

2. CKLS Method for Parameter Estimation (elaborated by GMM and Euler Approx)

3. Application

1. Plotting Vasicek Trajectories

  (1) Basic outlooking:

vasicek <- function(alpha, beta, sigma, n = 100, r0 = 0.026) {
        v <- rep(0, n)
        v[1] <- r0
        for (i in 2:n) {
                v[i] <- v[i - 1] + alpha * (beta - v[i - 1]) + sigma * rnorm(1)
        }
        return(v)
}
set.seed(13)
r <- replicate(3, vasicek(0.02, 0.056, 0.0006))
# plot columns of matrix against columns of another matrix
matplot(r, type = l, ylab = ‘‘, xlab = Time, xaxt = no,
        main = Simulation of Interest Rate Using Vasicek Trajectories)
lines(c(-1, 101), c(0.056, 0.056), col = grey, lwd = 2, lty = 1)

 技术图片

  (2) Characteristics:

# change sigma (old sigma is 0.0006)
r <- sapply(c(0, 0.0003, 0.0009),
            function(sigma){
                    set.seed(23); vasicek(0.02, 0.056, sigma)
            })
matplot(r, type = l, ylab = ‘‘, xlab = Time, xaxt = no,
        main = Vasicek Simulation with sigma 0, 0.03%, 0.09%)

技术图片

# change alpha (old alpha is 0.02)
r <- sapply(c(0.002, 0.02, 0.2),
            function(alpha){
                    set.seed(33); vasicek(alpha, 0.056, 0.0006)
            })
matplot(r, type = l, ylab = ‘‘, xlab = Time, xaxt = no,
        main = Vasicek Simulation with alpha 0.2%, 2%, 20%)

技术图片

  (3) Comments:

    This model is a continuous, affine and one-factor stochastic interest rate model.

    It follows a mean-reverting process (expected value converges to beta when Time of alpha goes to infinity (alpha can be treated as speed of adjustment to the     long-run beta). The higher alpha, the earlier reach long-term beta (which input by me as 0.056). As alpha goes infinity, variance converges to 0.

 


 

2. Parameter Estimation

  (1) Generalized Method of Moments:

    gamma = 0 in Vasicek model;

    gamma = 0.5 in CIR model (which assumes that volatility term proportional to the square root of the interest rate level; and that interest rate has non-central

     chi-squared distribution);

  (2) Mechanism:

    Denote a vector of parameters to be estimated, theta = (alpha, beta, sigma, gamma);

    Set null hypothesis is : E[ Mt(theta) ] = 0;

    Use a sample corresponding to E[ Mt(theta) ], which is denoted as mt(theta) = (1/n) * Σ Mt(theta), where t from 1 to n, and n is number of observations;

    Introduce omega as a weight matrix, which is symmetric, positive and definite;

    Thus, GMM minimize this quadratic term: mt(theta)Ω(theta)mt(theta);

 


 

3. Application 

  (1) Simulate bond prices with different maturities:

 

library(SMFI5)
a <- bond.vasicek(alpha = 0.5, beta = 2.55, sigma = 0.365, q1 = 0.3, q2 = 0,
            r0 = 3.5, n = 1080, maturities = c(1/12, 3/12, 6/12, 1), days = 365)
plot(a)

 

技术图片

 

Derivative Pricing_2_Vasicek

标签:euler   sam   mic   type   comm   zed   mat   rom   run   

原文地址:https://www.cnblogs.com/sophhhie/p/12284577.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!