bond_prices: Bond Price Calculation

Description Usage Arguments Value See Also Examples

Description

Function for the calculation of bond prices according to the chosen approach (Diebold/Li, Nelson/Siegel, Svensson) based on the cashflows and maturities matrix of the bonds.

Usage

1
bond_prices(method = "ns", beta, m, cf, lambda)

Arguments

method

defines the desired method: "ns" for the Nelson/Siegel,"dl" for Diebold/Li, "sv" for the Svensson approach.

beta

parameter vector, is linked to the chosen approach.

m

maturities matrix, consists of the maturity dates which are appended to the cashflows of the bonds.

cf

cashflows matrix.

lambda

additional parameter for the "dl" spot rate function

Value

Returns a list with:

spot_rates

spot rates matrix

discount_factors

discount factors matrix

bond_prices

bond prices vector

See Also

spotrates

Examples

1
2
3
4
5
data(govbonds)
cf <- create_cashflows_matrix(govbonds[[1]])
m <- create_maturities_matrix(govbonds[[1]])
beta <- c(0.0511,-0.0124,-0.0303,2.5429)
bond_prices(method="ns",beta,m,cf)$bond_prices

changshun/termstrc documentation built on May 13, 2019, 3:24 p.m.