Multiple users requested to have an external threshold in TVAR.sim. This is currently not possible, triggering message Cannot (yet) bootstrap model with external thVar or commonInter.
I won't have time to do this anytime soon, but here would some steps to follow:
[ ] tsDyn:::TVAR.gen has thVar but uses z2 ( as in if (round(z2[i - thDelay], round_digits) <= Thresh[1])), so need to replace
library(tsDyn)
#> Registered S3 method overwritten by 'quantmod':
#> method from
#> as.zoo.data.frame zoo
## works with internal thVar
tv <- TVAR(zeroyld, lag=2, nthresh=1, thDelay=1, trim=0.1, mTh=1, plot=FALSE)
#> Best unique threshold 10.653
head(TVAR.boot(tv),2)
#> short.run long.run
#> [1,] 2.183 1.575
#> [2,] 2.246 1.545
## works with internal
tv_ext <- TVAR(zeroyld, lag=2, nthresh=1, thVar=rnorm(nrow(zeroyld)), plot=FALSE)
#> Best unique threshold -1.341946
TVAR.boot(tv_ext)
#> Error in TVAR.boot(tv_ext): Cannot (yet) bootstrap model with external thVar or commonInter
Multiple users requested to have an external threshold in TVAR.sim. This is currently not possible, triggering message
Cannot (yet) bootstrap model with external thVar or commonInter
.I won't have time to do this anytime soon, but here would some steps to follow:
tsDyn:::TVAR.gen
hasthVar
but usesz2
( as inif (round(z2[i - thDelay], round_digits) <= Thresh[1])
), so need to replaceCreated on 2022-10-16 by the reprex package (v2.0.1)