Skip to content

YieldCurve package

4 messages · Jeff Ryan, Joshua Ulrich, jaimie villanueva

#
Try posting sessionInfo(). Your packages matter far more than your system in 99.99% of cases. 

Also, providing the result of traceback() immediately after the failed call can be illustrative. 

Best,
Jeff

Jeffrey Ryan    |    Founder    |    jeffrey.ryan at lemnica.com

www.lemnica.com
On Aug 11, 2013, at 10:56 AM, jaimie villanueva <jaimie.villanueva at gmail.com> wrote:

            
#
Hi Jaimie,

The YieldCurve package works much better if you use a time-series of
rates/maturities.  For example, using xts:

# create xts object with a custom "maturity" attribute
x <- xts(t(NEW.VECT.1[,2]), Sys.Date(), maturity=NEW.VECT.1[,1],
  dimnames=list(NULL, paste("X", NEW.VECT.1[,1], sep="")))
xNSParam <- Nelson.Siegel(rate=x, maturity=attr(x,'maturity'))
xFitted <- NSrates(xNSParam, attr(x,'maturity'))

If you just want your code to work, convert NSParameters to xts before
you call NSrates:
fitted.rates= NSrates(xts(NSParameters,Sys.Date()), NEW.VECT.1[,1])

Best,
--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com


On Sun, Aug 11, 2013 at 10:56 AM, jaimie villanueva
<jaimie.villanueva at gmail.com> wrote: