Description Usage Arguments Value Examples
The command estimates the spot rates using the De Rezende-Ferreira 5 Factor model
1 | DRF.5F.rates(beta, maturity)
|
beta |
Matrix or Vector of class "zoo", which contains the coefficients of the De Rezende-Ferreira 5 Factor model: ≤ft( β_{0t},β_{1t}, β_{2t}, β_{3t}, β_{4t}, τ_{1t}, τ_{2t} \right) |
maturity |
Vector of class "numeric", wich contains the maturities |
An object of class "xts" - "zoo", which contains fitted interest rates
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | #
# Fitting the Chinese spot rates using the De Rezende-Ferreira 5F moodel with Variable tau
#
data(ZC_China)
real.rate = ZC_China
ZC_China[["Date"]] = NULL
rate = zoo(ZC_China)
index(rate) = as.POSIXct(paste(real.rate[["Date"]]))
maturity <- c(1,2,3,4,5,6,7,8,9,10,12,15,20,30)
RF.5F.Parameters <- DRF.5F.tVar(rate, maturity)
RF.5F.Rates <- DRF.5F.rates(RF.5F.Parameters, maturity )
plot(maturity,rate[5,],xlab="Maturity",ylab="Yields",ylim=c(3.5,4.7),col="black",lwd = 1)
lines(maturity, RF.5F.Rates[5,], col = "blue", lwd = 1)
grid(nx = 12, ny = 12)
#
#
#
#
# Fitting the South African spot rates using the De Rezende-Ferreira 5F model with fixed tau
#
data(ZC_SouthAfrica)
real.rate = ZC_SouthAfrica
ZC_SouthAfrica[["Date"]] = NULL
rate = zoo(ZC_SouthAfrica)
index(rate) = as.POSIXct(paste(real.rate[["Date"]]))
maturity <- c(0.25, 1,2,3,4,5,6,7,8,9,10,12,15,20,25,30)
fixed_tau1 = (1.07612)
fixed_tau2 = (6.23293)
RF.5F.Parameters <- DRF.5F.tFix(rate, maturity, fixed_tau1, fixed_tau2)
RF.5F.Rates <- DRF.5F.rates(RF.5F.Parameters, maturity )
plot(maturity,rate[5,],xlab="Maturity",ylab="Yields",ylim=c(6.5,10.0),col="black",lwd = 1)
lines(maturity, RF.5F.Rates[5,], col = "blue", lwd = 1)
grid(nx = 12, ny = 12)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.