impl_fwr: Implied Forward Rate Calculation

Description Usage Arguments Details Value Examples

View source: R/spotfwdratedef.R

Description

Calculates the implied forward rates from given spot rates.

Usage

1
impl_fwr(m, s)

Arguments

m

maturity vector.

s

spot rate vector.

Details

Implied forward rates can be calculated using the following relationship:

f(t',T) = \frac{s(m_T)m_T - s(m_{t'})m_{t'}}{m_T-m_{t'}},

whereas s(m_T), s(m_{t'}) is the spot rate for a maturity m_T,m_{t'} respectively.

Value

The function returns the calculated forward rate vector.

Examples

1
2
s <-  spr_ns(c(0.03,0.02,0.01,5),1:30)
impl_fwr(s,m=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.04704251 0.04704251 0.04516831 0.04341359 0.04179661 0.04032510
 [7] 0.03899945 0.03781513 0.03676447 0.03583791 0.03502500 0.03431497
[13] 0.03369725 0.03316168 0.03269880 0.03229984 0.03195684 0.03166262
[19] 0.03141077 0.03119559 0.03101207 0.03085579 0.03072292 0.03061010
[25] 0.03051442 0.03043339 0.03036483 0.03030688 0.03025796 0.03021669

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