Open TanguyBarthelemy opened 1 year ago
Your previous code works now since https://github.com/rjdemetra/rjd3toolkit/pull/1. However, it doesn't seems to work:
y = rjd3toolkit::ABS$X0.2.09.10.M
spec <- rjd3toolkit::set_outlier(
rjd3x13::spec_regarima("rsa5c"),
outliers.type = c("AO","LS"),
critical.value = c(1, 100))
list2DF(spec$outlier$outliers) # OK
#>
#> 1 AO LS
#> 2 1 100
ud_var <- c("regression.nao", "regression.nls")
spec$outlier$defva
#> [1] 1
rjd3x13::fast_regarima(y,spec, userdefined = ud_var)$user_defined
#> $regression.nao
#> [1] 20
#>
#> $regression.nls
#> [1] 10
#>
#> attr(,"class")
#> [1] "user_defined"
spec$outlier$defva <- 0
rjd3x13::fast_regarima(y,spec, userdefined = ud_var)$user_defined
#> $regression.nao
#> [1] 2
#>
#> $regression.nls
#> [1] 0
#>
#> attr(,"class")
#> [1] "user_defined"
spec$outlier$defva <- NULL
rjd3x13::fast_regarima(y,spec, userdefined = ud_var)$user_defined
#> $regression.nao
#> [1] 2
#>
#> $regression.nls
#> [1] 0
#>
#> attr(,"class")
#> [1] "user_defined"
spec$outlier$defva <- 100
rjd3x13::fast_regarima(y,spec, userdefined = ud_var)$user_defined
#> $regression.nao
#> [1] 0
#>
#> $regression.nls
#> [1] 0
#>
#> attr(,"class")
#> [1] "user_defined"
Ok thank you Alain again for your quick answer. I was using an obsolete version of rjd3x13 and I didn't check the other issues from the rjduniverse ! Do you want to close this issue and raise another for your remark or keep this one up ?
(copy of the issue palatej/rjd3x13#21)
Ok then, how to specity different critical values for different outlier types (in X13) ?
This program returns an error :
missing(critical.value) | is.na(critical.value)
at the beginning ofset_outlier.default
(to include length > 1 critical values) ?defva
?