【金融量化分析】#HW2 (Effective return;Duration and convexity;bootstrap method; minimum variance portfolios)

https://zhuanlan.zhihu.com/p/139262608#
利率衍生品定价的基础内容回顾

Q1(Effective return)

info

在这里插入图片描述

two ways to calculate the average of return
1)arithmetic average
2) geometric average

Head:
Tom and Amy both bought a 20-year pension with different return schemes. Tom’s pension has first year interest rate of 3% and will increase by 0.5% every year whilst Amy’s pension has a continuous interest rate of 7%. Both pension pays the interest annually. Compare the benefits of the two pensions by computing their effective rates of return.

%% Solution:
InterestR_Tom=[3:0.5:12.5]/100;
EffectiveR_Tom=(prod(1+[3:0.5:12.5]/100))^(1/20)-1;% 用平均来算
EffectiveR_Tom=prod(

EffectiveR_AMY=exp(0.07)-1;

if EffectiveR_Tom>EffectiveR_AMY
    disp('The pension of Tom has higher effective rate')
elseif EffectiveR_Tom<EffectiveR_AMY
    disp('The pension of Amy has higher effective rate')
else
    disp('The effective rates are equal')
end
   

Q2(Duration and convexity)

info

wirte a user_defined matlab-code and call it

function [Price,duration,convexity] = DurationConvexity(Face,Coupon,Maturity,yield)
% BondPrice, Duration and Convexity
    Time=0.5:0.5:Maturity; % time for payments
    C = 0.5*Coupon*Face; % one coupon payment
    Price = sum(C*exp(-yield*Time)) + Face*exp(-yield*Maturity);
    duration= sum( (C* Time.* exp(-yield*Time) )/ Price )+Face*Maturity*exp(-yield*Maturity)/Price;
    convexity = sum( (C.* (Time.
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值