esgfwdrates: Instantaneous forward rates

Description Usage Arguments Author(s) References Examples

View source: R/fwdrates.R

Description

This function provides instantaneous forward rates. They can be used in no-arbitrage short rate models, to fit the yield curve exactly.

Usage

1
2
3
4
5
6
7
8
esgfwdrates(
  in.maturities,
  in.zerorates,
  n,
  horizon,
  out.frequency = c("annual", "semi-annual", "quarterly", "monthly", "weekly", "daily"),
  ...
)

Arguments

in.maturities

input maturities

in.zerorates

input zero rates

n

number of independent observations

horizon

horizon of projection

out.frequency

either "annual", "semi-annual", "quarterly", "monthly", "weekly", or "daily" (1, 1/2, 1/4, 1/12, 1/52, 1/252)

...

additional parameters provided to ycinter

Author(s)

Thierry Moudiki

References

Thierry Moudiki (2013). ycinterextra: Yield curve or zero-coupon prices interpolation and extrapolation. R package version 0.1. URL https://CRAN.R-project.org/package=ycinterextra

Examples

 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
# 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')

## End(Not run)

ESGtoolkit documentation built on July 1, 2020, 11:24 p.m.