0

I am trying to run a threshold autoregressive model in "r" with the tsDyn package.

I have run the following command in "r":

Tar <- TVAR(spread, lag=1, include = c("both"), model = ("TAR"), thDelay = 1, trim=0.1, mTh = 1, plot=TRUE)

and i get the following error message:

Error in `colnames<-`(`*tmp*`, value = list(Bdown = NULL, Bup = NULL)) : 

length of 'dimnames' [2] not equal to array extent

My time series object looks like the following:

 > spread
           Qtr1       Qtr2       Qtr3       Qtr4
1973 0.06288020 0.06291441 0.06775660 0.06782501
1974 0.07044100 0.07100951 0.07721481 0.08238591
1975 0.08007791 0.07509880 0.07085930 0.07079081
1976 0.07589350 0.07920151 0.07823570 0.08212550
1977 0.08212750 0.08140471 0.07599191 0.07942870
...

Edit from request:

    > str(spread)
 Time-Series [1:175, 1] from 1973 to 2016: 0.0629 0.0629 0.0678 0.0678 0.0704 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr "udlån"

I do not understand the error message or what i can do to fix it?

I am extremely grateful for any help.

Best regards

Rasmus Damgaard

0 Answers0