*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. pytest-conftest.py作用范围

    1.conftest.py解释 conftest.py是pytest框架里面一个很重要的东西,它可以在这个文件里面编写fixture,而这个fixture的作用就相当于我们unittest框架里面的s ...

  2. tkinter的listbox、radiobutton和checkbutton学习(2)

    1.tkinter的listbox 1.1 代码 #第1步,导出模块 import tkinter as tk #定义窗口,及其标题.大小和位置 win = tk.Tk() win.title('Li ...

  3. SprintBoot学习(三)

    Thymeleaf模板引擎 1.thymeleaf是一个Java类库,,他是xml/xhtml/html5的模板引擎可以作为view层 2.themeleaf基本语法 引入thymeleaf < ...

  4. 吴裕雄--天生自然Numpy库学习笔记:NumPy 数据类型

    下表列举了常用 NumPy 基本类型. 名称 描述 bool_ 布尔型数据类型(True 或者 False) int_ 默认的整数类型(类似于 C 语言中的 long,int32 或 int64) i ...

  5. mysql数据库关系表设计原则

    三范式https://blog.csdn.net/qq_36432666/article/details/78934073 https://kb.cnblogs.com/page/138526/ ht ...

  6. WebView 中图片长按出现弹框,点击存储图像闪退的解决方案

    在使用 WKWebView 展示 H5 时,如果 H5 中有图片,长按图片会出现弹框,在 iOS11 系统中,存储图像,如果未开启相册权限,会直接 Crash 掉: 解决方案一(原生解决): 在代理方 ...

  7. [ NLP ] CS224N 学习笔记

    Lecture1 One-Hot 定义:用N位状态寄存器编码N个状态,每个状态都有独立的寄存器位,且这些寄存器位中只有一位有效,说白了就是只能有一个状态.即保证每个样本中的每个特征只有1位处于状态1, ...

  8. jenkins windows 2.204版,免安装,推荐插件齐备.

    windows专用,已安装好推荐插件, 更新了安装源为清华源,也就是说只要官方的插件,你都可以秒速下载了.香不? 解压到一个文件夹,管理员模式运行cmdcd 文件夹名jenkins install这样 ...

  9. Day11 - Q - A Multiplication Game HDU - 1517

    题目链接 本题很像bash博弈,但又有些许不同,因为这里是乘法,我们可以列出前几项可能 若n=2-9,那么first可以一次取完 若n=10-18,无论first怎么取,second都能一次取完 若n ...

  10. C++赋值操作符不能继承

    在网上搜索相关资料时,看到有人说,赋值操作符可以被继承,并且给出了一个例子. 一时间,也没想出那个例子错在哪里. 例子代码如下: #include <iostream> using nam ...