Description Usage Arguments Value See Also Examples
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.
1 | bond_prices(method = "ns", beta, m, cf, lambda)
|
method |
defines the desired method: |
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 |
Returns a list with:
spot_rates |
spot rates matrix |
discount_factors |
discount factors matrix |
bond_prices |
bond prices vector |
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.