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)), order.by = time(Coeff)) : order.by requires an appropriate time-based object
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.