spr_ns: Spot Rate Function according to Nelson and Siegel

Description Usage Arguments Details Value References Examples

View source: R/spotfwdratedef.R

Description

This function calculates the spot rates for certain maturity dates and a parameter vector according to Nelson/Siegel (1987).

Usage

1

Arguments

beta

a vector of parameters {\bm{β}} = ≤ft(β_0,β_1,β_2,τ_1\right).

m

one maturity (or a vector of maturities).

Details

The spot rate according to Nelson/Siegel for a maturity m is defined as:

s(m,\bm{β}) = β_0 + β_1\frac{1-\exp(-\frac{m}{τ_1})}{\frac{m}{τ_1}} + β_2≤ft(\frac{1-\exp(-\frac{m}{τ_1})}{\frac{m}{τ_1}} - \exp(-\frac{m}{τ_1})\right).

Value

Returns a vector consisting of the calculated spot rates.

References

Charles R. Nelson and Andrew F. Siegel (1987): Parsimonious Modeling of Yield Curves. The Journal of Business, 60(4):473–489.

Examples

1
spr_ns(rep(0.01,4),1:30)

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 
 [1] 0.01020000 0.01010000 0.01006667 0.01005000 0.01004000 0.01003333
 [7] 0.01002857 0.01002500 0.01002222 0.01002000 0.01001818 0.01001667
[13] 0.01001538 0.01001429 0.01001333 0.01001250 0.01001176 0.01001111
[19] 0.01001053 0.01001000 0.01000952 0.01000909 0.01000870 0.01000833
[25] 0.01000800 0.01000769 0.01000741 0.01000714 0.01000690 0.01000667

termstrc documentation built on May 29, 2017, 1:05 p.m.