Derivative Pricing_2_Vasicek

Posted sophhhie

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Derivative Pricing_2_Vasicek相关的知识,希望对你有一定的参考价值。

*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的主要内容,如果未能解决你的问题,请参考以下文章

10_InfluxDB常用函数变换类函数(DERIVATIVE, DIFFERENCE,ELAPSED,MOVING_AVERAGE,NON_NEGATIVE_DERIVATIVE)等(代

javascript product_sale_pricing_.js

javascript product_sale_pricing_.js

Sympy 简单的二阶颂歌

el-transfer高度(element版本2.13.0)

如何使用 influxdb non_negative_derivative 获得一致的值?