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的更多相关文章
- Derivative of the softmax loss function
Back-propagation in a nerual network with a Softmax classifier, which uses the Softmax function: \[\ ...
- Derivative of Softmax Loss Function
Derivative of Softmax Loss Function A softmax classifier: \[ p_j = \frac{\exp{o_j}}{\sum_{k}\exp{o_k ...
- 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: ...
- The Softmax function and its derivative
https://eli.thegreenplace.net/2016/the-softmax-function-and-its-derivative/ Eli Bendersky's website ...
- matlab 提示 Continuous sample time is not supported by discrete derivative 错误的解决办法
Simulink仿真的时候,出行错误提示:Continuous sample time is not supported by discrete derivative 中文意思是:连续采样时间不支持离 ...
- [PE484]Arithmetic Derivative
题意:对整数定义求导因子$'$:$p'=1,(ab)'=a'b+ab'$,求$\sum\limits_{i=2}^n(i,i')$ 这个求导定义得比较妙:$(p^e)'=ep^{e-1}$ 推一下就可 ...
- 【找规律】【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^ ...
- 共变导数(Covariant Derivative)
原文链接 导数是指某一点的导数表示了某点上指定函数的变化率. 比如,要确定某物体的速度在某时刻的加速度,就取时间轴上下一时刻的一个微小增量,然后考察速度的增量和时间增量的比值.如果这个比值比较大,说明 ...
- 求导四则运算以及三角函数求导 Derivative formulas
对特定函数的求导. 1:sin(x) 对其进行求斜率.带入公式得:[ sin(x+Δx)- sin(x)]/Δx = [ sinx*cosΔx + cosx*sinΔx -sin x ]/ Δx = ...
随机推荐
- sso系统登录以及jsonp原理
登录的处理流程: 1.登录页面提交用户名密码. 2.登录成功后生成token.Token相当于原来的jsessionid,字符串,可以使用uuid. 3.把用户信息保存到redis.Key就是toke ...
- java 8 list的stream操作 list中的对象中的某一个成员取出转为该成员的list,以及对象过滤,筛选某个属性后的成员
取成员属性list List<String> configList = codeEntityList.stream().map(t -> t.getName()).distinct( ...
- 基于docker的以太坊集群的私有链开发环境
转载博文:https://www.jianshu.com/p/8af386ec5f9e https://www.jianshu.com/p/7994db7a2b89?from=singlemessag ...
- js脚本中执行java后台代码
使用场景:关闭页面弹窗时执行sql语句. 其实js里执行sql语句有多种方式. 方式一:直接在js代码里调用sql语句,原则上不能使用,因为这将sql直接暴露在客户端,安全性极差. 方式二:在js里运 ...
- CDH 搭建 问题
1. 问题描述: java.sql.SQLException: Access denied for user 'xxx'@'xxx.xxx.xxx.xxx' (using password: YES ...
- CSS - 精灵Sprite
1. CSS精灵是一种处理网页背景图像的方式. 2. 它将一个页面涉及到的所有零星背景图像都集中到一张大图中去,然后将大图应用于网页,这样,当用户访问该页面时,只需向服务发送一次请求,网页中的背景图像 ...
- Pandas 性能优化 学习笔记
摘要 本文介绍了使用 Pandas 进行数据挖掘时常用的加速技巧. 实验环境 import numpy as np import pandas as pd print(np.__version__) ...
- Ubuntu 16.04 安装Redis服务器端
~ sudo apt-get install redis-server 安装完成后,Redis服务器会自动启动,我们检查Redis服务器程序 检查Redis服务器系统进程 ~ ps -aux|grep ...
- JS获取CHECKBOX的值 AND 两个CHECKBOX 循环选中
获取多选按钮的值 var chk_value = ''; $('input[data-action="checkRole"]:checked').each(function(){ ...
- nginx 网络层的优化
TCP三次握手四次挥手 系统层的优化,主动建立连接时的重试次数 net.ipv4.tcp_syn_retries = 6 建立连接时本地端口可用范围:手动可以tiaoz net.ipv4.ip_loc ...