I am Julia Cains from Brisbane. This is my
first mail to this group and I have recently started learning the R language.

 

I am trying to learn the smoothening
of the yield curve. However, I came across the CRAN package – “YieldCurve”
meant for Modelling and estimation of the yield curve. The problem is I am not
able to understand whether this package will help me to carry out smoothening of
the curve.

 

The related pdf file consists
of following R code.

 

 

YieldCurve-package Modelling
and estimation of the yield curve (Page 2)

 # __________________________________________________


data(FedYieldCurve)

tau <- c(3, 6, 12, 60, 84,
120)

mediumTerm <- c(12,60,84)

NSParameters <-
Nelson.Siegel( rate=FedYieldCurve[1:10,], maturity=tau, MidTau=mediumTerm )

y <-
NSrates(NSParameters[5,1:3],

NSParameters$lambda[5],tau)

plot(tau,FedYieldCurve[5,],main="Fitting
Nelson-Siegel yield curve", type="o")

lines(tau,y, col=2)

legend("topleft",legend=c("observed
yield curve","fitted yield curve"),

col=c(1,2),lty=1)

 

# __________________________________________________ 


The plot gives me two curves
(1) Observed yield curve and (2) Fitted yield curve.

 

 

Unfortunately I am not able
to interpret the result. 

 

The input has 330 records (i.e.
from January 1982 to June 2009) and each record has 6 yields given (for the 
period
3months, 6 months, 1 year, 5 years, 7 years and 10 years.)

 

Unfortunately I am not that good
in Mathematics. Can someone help me understand whether this code is meant for 
smoothening
of the yield curve. I shall be highly obliged. 

 

Regards

 

Julia

 






*******************************************



Only a man of Worth sees Worth in other men



*******************************************


      
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to