*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的更多相关文章

  1. Derivative of the softmax loss function

    Back-propagation in a nerual network with a Softmax classifier, which uses the Softmax function: \[\ ...

  2. Derivative of Softmax Loss Function

    Derivative of Softmax Loss Function A softmax classifier: \[ p_j = \frac{\exp{o_j}}{\sum_{k}\exp{o_k ...

  3. XVII Open Cup named after E.V. Pankratiev Stage 14, Grand Prix of Tatarstan, Sunday, April 2, 2017 Problem A. Arithmetic Derivative

    题目:Problem A. Arithmetic DerivativeInput file: standard inputOutput file: standard inputTime limit: ...

  4. The Softmax function and its derivative

    https://eli.thegreenplace.net/2016/the-softmax-function-and-its-derivative/  Eli Bendersky's website ...

  5. matlab 提示 Continuous sample time is not supported by discrete derivative 错误的解决办法

    Simulink仿真的时候,出行错误提示:Continuous sample time is not supported by discrete derivative 中文意思是:连续采样时间不支持离 ...

  6. [PE484]Arithmetic Derivative

    题意:对整数定义求导因子$'$:$p'=1,(ab)'=a'b+ab'$,求$\sum\limits_{i=2}^n(i,i')$ 这个求导定义得比较妙:$(p^e)'=ep^{e-1}$ 推一下就可 ...

  7. 【找规律】【DFS】XVII Open Cup named after E.V. Pankratiev Stage 14, Grand Prix of Tatarstan, Sunday, April 2, 2017 Problem A. Arithmetic Derivative

    假设一个数有n个质因子a1,a2,..,an,那么n'=Σ(a1*a2*...*an)/ai. 打个表出来,发现一个数x,如果x'=Kx,那么x一定由K个“基础因子”组成. 这些基础因子是2^2,3^ ...

  8. 共变导数(Covariant Derivative)

    原文链接 导数是指某一点的导数表示了某点上指定函数的变化率. 比如,要确定某物体的速度在某时刻的加速度,就取时间轴上下一时刻的一个微小增量,然后考察速度的增量和时间增量的比值.如果这个比值比较大,说明 ...

  9. 求导四则运算以及三角函数求导 Derivative formulas

    对特定函数的求导. 1:sin(x) 对其进行求斜率.带入公式得:[ sin(x+Δx)- sin(x)]/Δx  = [ sinx*cosΔx + cosx*sinΔx -sin x ]/ Δx = ...

随机推荐

  1. ES6-let声明变量

    在es6中除了var还可以用let申明变量,并且建议使用let而不要再使用var,两者有以下区别: 1.let不能重复声明变量 var name = 'tom'; var name = 'jack'; ...

  2. [经验] 如何在虚拟机上安装 CentOS

    环境配置 虚拟机 vmware 15.5 Pro 操作系统 CentOS-7-x86_64-DVD-1908.iso 第一步: 在虚拟机上打开操作系统的镜像文件并配置硬件信息 这里的操作就是一本道  ...

  3. 8.1.1默认的map函数、reduce函数、分区函数

    1.1.1         默认的map函数和reduce函数 (1)Maper和Reuducer默认类 如果没有指定maper类和reduce类,则会用默认的Maper和Reuducer类去处理数据 ...

  4. vb.net与vb的区别

    本文链接:https://blog.csdn.net/dfshsdr/article/details/63255645最近接触了vb.net,它增加了vb的很多特性,而且演化成为完全面向对象的编程语言 ...

  5. python面试题手动总结答案锦集

    数据类型 字符串 1.列举python中的基本数据类型 数字:int 布尔值:bool 字符串:str 列表:list 元组:tuple 字典:dict 集合:set 然后我们需要了解一些运算符,应为 ...

  6. LinkedHashMap的用法

    1:LinkedHashMap的简介 Map 接口的哈希表和链接列表实现,具有可预知的迭代顺序.此实现与 HashMap 的不同之处在于,后者维护着一个运行于所有条目的双重链接列表.此链接列表定义了迭 ...

  7. springboot下使用dubbo的简单demo

    1.一些话 现在java后端开发大多用springboot来简化环境搭建,现在一直使用的是springcloud和k8s有关的东西,以前用过dubbo,但那会儿的开发环境搭建流程较为繁琐,而且不支持r ...

  8. Ubuntu18.04下Qt5.9.8连接mysql数据库失败的解决办法

    问题: 连接mysql数据库时,出现如下 提示: QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQ ...

  9. Java中使用JSONTokener判断接口返回字符串是JSONObject还是JSONArray

    今天在接口对接中,遇到一个问题,对方接口返回的JSONString,类型不确定,所以需要先做判断再进行处理.查阅资料后使用JSONTokener可进行处理,特此记录. String ret = ord ...

  10. 通过命令行提交更新代码到gitlab上

    解决方法: 1.打开命令行的窗口,定位到项目所在的路径. 2.输入:git status,敲回车查看代码是否有更新,有更新的话会出现文件改变的文件名.(红色的) 3.输入:git commit -a ...