# NOT RUN {
# Yield to maturities
txZC <- c(0.01422,0.01309,0.01380,0.01549,0.01747,0.01940,0.02104,0.02236,0.02348,
0.02446,0.02535,0.02614,0.02679,0.02727,0.02760,0.02779,0.02787,0.02786,0.02776
,0.02762,0.02745,0.02727,0.02707,0.02686,0.02663,0.02640,0.02618,0.02597,0.02578,0.02563)
# Observed maturities
u <- 1:30
# }
# NOT RUN {
par(mfrow=c(2,2))
fwdNS <- esgfwdrates(in.maturities = u, in.zerorates = txZC,
n = 10, horizon = 20,
out.frequency = "semi-annual", method = "NS")
matplot(time(fwdNS), fwdNS, type = 'l')
fwdSV <- esgfwdrates(in.maturities = u, in.zerorates = txZC,
n = 10, horizon = 20,
out.frequency = "semi-annual", method = "SV")
matplot(time(fwdSV), fwdSV, type = 'l')
fwdSW <- esgfwdrates(in.maturities = u, in.zerorates = txZC,
n = 10, horizon = 20,
out.frequency = "semi-annual", method = "SW")
matplot(time(fwdSW), fwdSW, type = 'l')
fwdHCSPL <- esgfwdrates(in.maturities = u, in.zerorates = txZC,
n = 10, horizon = 20,
out.frequency = "semi-annual", method = "HCSPL")
matplot(time(fwdHCSPL), fwdHCSPL, type = 'l')
# }
Run the code above in your browser using DataLab