Can't understand error message

Hi! I hope someone could help me to understand the following error. I have to calculate the Nelson-Siegel Interest rates. First, I find the parameters (function "Nelson.Siegel()"), than I have to use the function "NSrates()". I use as coefficient the parameters and as maturity the vector of my maturities, but R gives me this:

Error in xts(matrix(0, nrow(Coeff), length(maturity)), = time(Coeff)) : requires an appropriate time-based object

How can I overcome the problem?? Thanks!

@Ari1 The error seems quite clear. The argument you are passing to needs to be a POSIXt or equivalent object.

Can you share some sample values from your Coeff vector? That'll help us determine what's going wrong.

I obtain these data (here they are exported in Excel), there are 108 coloumns. Then, as argument "tm" of the function, I have this vector: maturity<-c(0, 3/12, 0.5, 9/12, 1, 15/12, 1.5, 21/12, 2, 2.5, 3, 4, 5, 6, 7, 8, 9, 10).
If I run the command, R gives me the error.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.