As discussed with @gsucarrat, there remains an issue with call when using isat or arx in a sub-function:
## call issue with arx and isat
library(gets)
set.seed(123)
x <- rnorm(100)
estimate_module_fun <- function(x, ar){
ar_test = ar
isat(x, ar = ar_test)
}
predict_module_fun <- function(obj){
predict(obj, newmxreg = rnorm(10))
}
is_obj <- estimate_module_fun(x, ar = 2)
predict_module_fun(is_obj)
## same in arx
library(gets)
set.seed(123)
x <- rnorm(100)
estimate_module_fun <- function(x, ar){
ar_test = ar
arx(x, ar = ar_test)
}
predict_module_fun <- function(obj){
predict(obj, newmxreg = rnorm(10))
}
arx_obj <- estimate_module_fun(x, ar = 2)
predict_module_fun(is_obj)
This would need to be fixed in the predict functions. One potential fix could be by not relying on call as this only evaluates when executed - while making sure that it evaluates earlier (e.g. in isat.default() rather than later in predict.isat) could resolve this issue.
As discussed with @gsucarrat, there remains an issue with call when using
isatorarxin a sub-function:This would need to be fixed in the
predictfunctions. One potential fix could be by not relying oncallas this only evaluates when executed - while making sure that it evaluates earlier (e.g. inisat.default()rather than later inpredict.isat) could resolve this issue.