R/mod_bonds.R

Defines functions bond_price

# Meglio lasciare le funzioni semplici:
# Bond puo' essere tranquillamente una struttura dati
# pero' meglio passare tempo e cash flow come vettori separati
#
# I risultati poi come semplice 

# bond_price(seq(0.5,2,by=0.5), c(.1,.1,.1,1), tsi)

# Price
bond_price<-function(t, cf, TS){
  sum(get_df(TS, t) * cf)
}



# Duration

# Convexity
lampoverde/Der documentation built on May 23, 2019, 7:33 a.m.