| splines_estim {termstrc} | R Documentation |
Term structure and credit spread estimation using an cubic splines approach of McCulloch(1975).
splines_estim(group,
bonddata,
matrange = "all")
group |
vector defining the group of bonds used for the estimation,newline
e.g. c("GERMANY","AUSTRIA"). |
bonddata |
a data set of bonds in a list format. |
matrange |
use "all" for no restrictions, or restrict the
maturity range used for the estimation with c(lower,upper). |
groupbonddatastr() to explore the structure of the provided data sets.
The function splines_estim returns an object of the class "cubicsplines". The object
contains the following items (mainly lists):
group |
vector consisting of the bond groups used for the estimation. |
matrange |
either "none" or a vector with the maturity range. |
n_group |
the number of groups used for the optimisation. |
knotpoints |
one list for each group with the used knot points for the cubic splines estimation. |
spot |
one list for each group with an object of the class "spot_curves". |
spread |
one list for each group with an object of the class "s_curves". |
discount |
one list for each group with an object of the class "df_curves". |
forward |
one list for each group with an object of the class "fwr_curves". |
cf |
one list for each group with the cashflows matrix. |
m |
one list for each group with the maturity matrix. |
p |
one list for each group with the dirty prices. |
phat |
one list for each group with the estimated bond prices. |
perrors |
one list for each group with an object of the class "error" containing the price errors of the bonds and the associated maturities. |
y |
one list for each group with the bond yields and the associated maturities. |
yhat |
one list for each group with the theoretical bond yields calculated with the estimated bond prices phat. |
yerrors |
one list for each group with an object of the class "error" containing the yield errors of the bonds and the associated maturities. |
alpha |
OLS coefficients of cubic splines estimation. |
regout |
one list for each group with an object of the class "lm". |
For objects of the class "spot_curves",
"s_curves", "df_curves", "fwr_curves", "error" appropriate plot methods are offered. For objects of the list item regout standard lm methods apply. For objects of the class "cubicsplines" print, summary and plot methods are available. Another term structure estimation method is provided by the function nelson_estim.
J.Huston McCulloch (1971): Measuring the Term Structure of Interest Rates. The Journal of Business, 44 19–31.
J. Huston McCulloch (1975): The Tax-Adjusted Yield Curve. The Journal of Finance, 30 811–830.
print.cubicsplines, summary.cubicsplines, plot.cubicsplines, nelson_estim, plot.spot_curves, plot.s_curves, plot.df_curves, plot.fwr_curves, plot.error, summary.lm, print.lm, plot.lm.
# load data set
data(eurobonds)
# define countries, for which the estimation
# of the zero-coupon yield curves will be carried out
group <- c("GERMANY", "AUSTRIA", "ITALY")
# define data set
bonddata <- eurobonds
# set maturtiy range
matrange <- c(0, 19)
# perform estimation
x <- splines_estim(group, bonddata, matrange)
# print the obtained parameters of the estimation
print(x)
# goodness of fit measures
summary(x)
# plot the zero-coupon yield curve for each country
plot(x,errors="none")
# plot all zero-coupon yield curves together
plot(x,multiple=TRUE,errors="none")
# spread curve splot
plot(x,ctype="spread",errors="none")
# price error plot for all countries
plot(x,ctype="none")