-
Notifications
You must be signed in to change notification settings - Fork 8
/
udvar.R
201 lines (194 loc) · 13.4 KB
/
udvar.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
.add_ud_var <- function(x, jx, userdefined = NULL, out_class = NULL, result = FALSE){
if (is.null(userdefined)) {
x$user_defined = rjd3toolkit::user_defined(x, NULL)
} else {
if (result) {
res = jx
} else {
if (is.null(out_class)) {
res = jx$getResult()
} else {
res = .jcall(jx, out_class, "getResult")
}
}
res = rjd3toolkit::.jd3_object(res, result = TRUE)
x$user_defined = rjd3toolkit::user_defined(res, userdefined = userdefined)
}
x
}
#' Display a list of all the available output objects
#'
#' @description
#' Function generating a comprehensive list of available output variables (series, parameters, diagnostics) from the estimation process
#' by the `x13()`, `regarima()` and `x11()` functions.
#' Some items are available in the default estimation output but the remainder can be added
#' using the `userdefined` parameter.
#' User-defined objects can the be retrieved from the list of lists generated by the estimation process
#'
#'@param x a character to indicate the estimation function for which the output items list will be displayed.
#'
#'@examples
#' userdefined_variables_x13("x13")
#' userdefined_variables_x13("regarima")
#' userdefined_variables_x13("x11")
#' @return a vector containing the names of all the available output objects (series, diagnostics, parameters)
#' @references
#' More information and examples related to 'JDemetra+' features in the online documentation:
#' \url{https://jdemetra-new-documentation.netlify.app/}
#' @export
userdefined_variables_x13 <- function(x = c("X-13","RegArima","X-11")){
x <- match.arg(gsub("-", "", tolower(x)),
choices = c("x13", "regarima", "x11"))
# library(rjd3x13)
# jts<-rjd3toolkit::.r2jd_tsdata(rjd3toolkit::ABS$X0.2.09.10.M)
# jrslt<- rJava::.jcall("jdplus/x13/base/r/X13", "Ljdplus/x13/base/core/x13/X13Output;", "fullProcess", jts, "RSA3")
# rjd3toolkit::dictionary(rjd3toolkit::.jd3_object(jrslt$getResult(), result = TRUE)) |>
# sort() |>
# dput()
sa_x13 = c("adjust", "arima.bd", "arima.bp", "arima.bphi(*)", "arima.bq",
"arima.btheta(*)", "arima.d", "arima.p", "arima.phi(*)", "arima.q",
"arima.theta(*)", "benchmarking.original", "benchmarking.result",
"benchmarking.target", "cal", "cal_b", "cal_b(?)", "cal_f", "cal_f(?)",
"decomposition.b1", "decomposition.b10", "decomposition.b11",
"decomposition.b13", "decomposition.b17", "decomposition.b2",
"decomposition.b20", "decomposition.b3", "decomposition.b4",
"decomposition.b5", "decomposition.b6", "decomposition.b7", "decomposition.b8",
"decomposition.b9", "decomposition.c1", "decomposition.c10",
"decomposition.c11", "decomposition.c13", "decomposition.c17",
"decomposition.c2", "decomposition.c20", "decomposition.c4",
"decomposition.c5", "decomposition.c6", "decomposition.c7", "decomposition.c9",
"decomposition.d1", "decomposition.d10", "decomposition.d11",
"decomposition.d12", "decomposition.d13", "decomposition.d2",
"decomposition.d4", "decomposition.d5", "decomposition.d6", "decomposition.d7",
"decomposition.d8", "decomposition.d9", "decomposition.d9-global-msr",
"decomposition.d9-msr", "decomposition.d9-msr-table", "decomposition.i_cmp",
"decomposition.s_cmp", "decomposition.s_cmp_b", "decomposition.s_cmp_f",
"decomposition.sa_cmp", "decomposition.sa_cmp_b", "decomposition.sa_cmp_f",
"decomposition.seasonal-filters", "decomposition.si_cmp", "decomposition.t_cmp",
"decomposition.t_cmp_b", "decomposition.t_cmp_f", "decomposition.trend-filter",
"decomposition.x11-all", "decomposition.y_cmp", "decomposition.y_cmp_b",
"decomposition.y_cmp_f", "det", "det_b(?)", "det_f(?)", "det_i",
"det_i_b(?)", "det_i_f(?)", "det_s", "det_s_b(?)", "det_s_f(?)",
"det_t", "det_t_b(?)", "det_t_f(?)", "diagnostics.fcast-insample-mean",
"diagnostics.fcast-outsample-mean", "diagnostics.fcast-outsample-variance",
"diagnostics.seas-i-combined", "diagnostics.seas-i-combined3",
"diagnostics.seas-i-evolutive", "diagnostics.seas-i-f", "diagnostics.seas-i-friedman",
"diagnostics.seas-i-kw", "diagnostics.seas-i-periodogram", "diagnostics.seas-i-qs",
"diagnostics.seas-i-spectralpeaks", "diagnostics.seas-i-stable",
"diagnostics.seas-lin-combined", "diagnostics.seas-lin-evolutive",
"diagnostics.seas-lin-f", "diagnostics.seas-lin-friedman", "diagnostics.seas-lin-kw",
"diagnostics.seas-lin-periodogram", "diagnostics.seas-lin-qs",
"diagnostics.seas-lin-spectralpeaks", "diagnostics.seas-lin-stable",
"diagnostics.seas-res-combined", "diagnostics.seas-res-combined3",
"diagnostics.seas-res-evolutive", "diagnostics.seas-res-f", "diagnostics.seas-res-friedman",
"diagnostics.seas-res-kw", "diagnostics.seas-res-periodogram",
"diagnostics.seas-res-qs", "diagnostics.seas-res-spectralpeaks",
"diagnostics.seas-res-stable", "diagnostics.seas-sa-ac1", "diagnostics.seas-sa-combined",
"diagnostics.seas-sa-combined3", "diagnostics.seas-sa-evolutive",
"diagnostics.seas-sa-f", "diagnostics.seas-sa-friedman", "diagnostics.seas-sa-kw",
"diagnostics.seas-sa-periodogram", "diagnostics.seas-sa-qs",
"diagnostics.seas-sa-spectralpeaks", "diagnostics.seas-sa-stable",
"diagnostics.seas-si-combined", "diagnostics.seas-si-combined3",
"diagnostics.seas-si-evolutive", "diagnostics.seas-si-stable",
"diagnostics.td-i-all", "diagnostics.td-i-last", "diagnostics.td-res-all",
"diagnostics.td-res-last", "diagnostics.td-sa-all", "diagnostics.td-sa-last",
"ee", "ee_b(?)", "ee_f(?)", "finals.d11", "finals.d11a", "finals.d11b",
"finals.d12", "finals.d12a", "finals.d12b", "finals.d13", "finals.d16",
"finals.d16a", "finals.d16b", "finals.d18", "finals.d18a", "finals.d18b",
"finals.e1", "finals.e11", "finals.e2", "finals.e3", "i", "l",
"likelihood.adjustedll", "likelihood.aic", "likelihood.aicc",
"likelihood.bic", "likelihood.bic2", "likelihood.bicc", "likelihood.df",
"likelihood.hannanquinn", "likelihood.ll", "likelihood.neffectiveobs",
"likelihood.nobs", "likelihood.nparams", "likelihood.ssqerr",
"log", "m-statistics.m1", "m-statistics.m10", "m-statistics.m11",
"m-statistics.m2", "m-statistics.m3", "m-statistics.m4", "m-statistics.m5",
"m-statistics.m6", "m-statistics.m7", "m-statistics.m8", "m-statistics.m9",
"m-statistics.q", "m-statistics.q-m2", "mhe", "mhe_b(?)", "mhe_f(?)",
"omhe", "omhe_b(?)", "omhe_f(?)", "out", "out_b(?)", "out_f(?)",
"out_i", "out_i_b(?)", "out_i_f(?)", "out_s", "out_s_b(?)", "out_s_f(?)",
"out_t", "out_t_b(?)", "out_t_f(?)", "period", "preadjustment.a1",
"preadjustment.a1a", "preadjustment.a1b", "preadjustment.a6",
"preadjustment.a7", "preadjustment.a8", "preadjustment.a8i",
"preadjustment.a8s", "preadjustment.a8t", "preadjustment.a9",
"preadjustment.a9sa", "preadjustment.a9ser", "preadjustment.a9u",
"reg_i", "reg_i_b(?)", "reg_i_f(?)", "reg_s", "reg_s_b(?)", "reg_s_f(?)",
"reg_sa", "reg_sa_b(?)", "reg_sa_f(?)", "reg_t", "reg_t_b(?)",
"reg_t_f(?)", "reg_u", "reg_u_b(?)", "reg_u_f(?)", "reg_y", "reg_y_b(?)",
"reg_y_f(?)", "regression.description", "regression.details.coefficients",
"regression.details.covar", "regression.details.covar-ml", "regression.easter",
"regression.espan.end", "regression.espan.missing", "regression.espan.n",
"regression.espan.start", "regression.leaster", "regression.lp",
"regression.mean", "regression.missing(*)", "regression.ml.parameters",
"regression.ml.pcorr", "regression.ml.pcovar", "regression.ml.pcovar-ml",
"regression.ml.pscore", "regression.mu", "regression.nao", "regression.nlp",
"regression.nls", "regression.nmh", "regression.nout", "regression.nso",
"regression.ntc", "regression.ntd", "regression.nusers", "regression.out(*)",
"regression.outlier(*)", "regression.td(*)", "regression.type",
"regression.user(*)", "residuals.bp", "residuals.bp2", "residuals.doornikhansen",
"residuals.kurtosis", "residuals.lb", "residuals.lb2", "residuals.lruns",
"residuals.ludruns", "residuals.mean", "residuals.nruns", "residuals.nudruns",
"residuals.res", "residuals.seasbp", "residuals.seaslb", "residuals.ser",
"residuals.skewness", "residuals.tsres", "residuals.type", "s",
"s_b", "s_f", "sa", "sa_b", "sa_f", "span.end", "span.missing",
"span.n", "span.start", "t", "t_b", "t_f", "tde", "tde_b(?)",
"tde_f(?)", "variancedecomposition.cycle", "variancedecomposition.irregular",
"variancedecomposition.others", "variancedecomposition.seasonality",
"variancedecomposition.tdh", "variancedecomposition.total", "y",
"y_b", "y_b(?)", "y_eb(?)", "y_ef(?)", "y_f", "y_f(?)", "yc",
"ycal", "ycal_f(?)")
# jts<-rjd3toolkit::.r2jd_tsdata(rjd3toolkit::ABS$X0.2.09.10.M)
# jrslt<- rJava::.jcall("jdplus/x13/base/r/RegArima", "Ljdplus/x13/base/core/x13/regarima/RegArimaOutput;", "fullProcess", jts, "RG3")
# rjd3toolkit::dictionary(rjd3toolkit::.jd3_object(jrslt$getResult(), result = TRUE)) |>
# sort() |>
# dput()
sa_regarima = c("adjust", "arima.bd", "arima.bp", "arima.bphi(*)", "arima.bq",
"arima.btheta(*)", "arima.d", "arima.p", "arima.phi(*)", "arima.q",
"arima.theta(*)", "cal", "cal_b(?)", "cal_f(?)", "det", "det_b(?)",
"det_f(?)", "det_i", "det_i_b(?)", "det_i_f(?)", "det_s", "det_s_b(?)",
"det_s_f(?)", "det_t", "det_t_b(?)", "det_t_f(?)", "ee", "ee_b(?)",
"ee_f(?)", "l", "likelihood.adjustedll", "likelihood.aic", "likelihood.aicc",
"likelihood.bic", "likelihood.bic2", "likelihood.bicc", "likelihood.df",
"likelihood.hannanquinn", "likelihood.ll", "likelihood.neffectiveobs",
"likelihood.nobs", "likelihood.nparams", "likelihood.ssqerr",
"log", "mhe", "mhe_b(?)", "mhe_f(?)", "omhe", "omhe_b(?)", "omhe_f(?)",
"out", "out_b(?)", "out_f(?)", "out_i", "out_i_b(?)", "out_i_f(?)",
"out_s", "out_s_b(?)", "out_s_f(?)", "out_t", "out_t_b(?)", "out_t_f(?)",
"period", "reg_i", "reg_i_b(?)", "reg_i_f(?)", "reg_s", "reg_s_b(?)",
"reg_s_f(?)", "reg_sa", "reg_sa_b(?)", "reg_sa_f(?)", "reg_t",
"reg_t_b(?)", "reg_t_f(?)", "reg_u", "reg_u_b(?)", "reg_u_f(?)",
"reg_y", "reg_y_b(?)", "reg_y_f(?)", "regression.description",
"regression.details.coefficients", "regression.details.covar",
"regression.details.covar-ml", "regression.easter", "regression.espan.end",
"regression.espan.missing", "regression.espan.n", "regression.espan.start",
"regression.leaster", "regression.lp", "regression.mean", "regression.missing(*)",
"regression.ml.parameters", "regression.ml.pcorr", "regression.ml.pcovar",
"regression.ml.pcovar-ml", "regression.ml.pscore", "regression.mu",
"regression.nao", "regression.nlp", "regression.nls", "regression.nmh",
"regression.nout", "regression.nso", "regression.ntc", "regression.ntd",
"regression.nusers", "regression.out(*)", "regression.outlier(*)",
"regression.td(*)", "regression.type", "regression.user(*)",
"residuals.bp", "residuals.bp2", "residuals.doornikhansen", "residuals.kurtosis",
"residuals.lb", "residuals.lb2", "residuals.lruns", "residuals.ludruns",
"residuals.mean", "residuals.nruns", "residuals.nudruns", "residuals.res",
"residuals.seasbp", "residuals.seaslb", "residuals.ser", "residuals.skewness",
"residuals.tsres", "residuals.type", "span.end", "span.missing",
"span.n", "span.start", "tde", "tde_b(?)", "tde_f(?)", "y", "y_b(?)",
"y_eb(?)", "y_ef(?)", "y_f(?)", "yc", "ycal", "ycal_f(?)")
# jts<-rjd3toolkit::.r2jd_tsdata(rjd3toolkit::ABS$X0.2.09.10.M)
# jrslt<- rJava::.jcall("jdplus/x13/base/r/X11", "Ljdplus/x13/base/core/x11/X11Results;", "process", jts,
# rjd3x13::.r2jd_spec_x11(rjd3x13::spec_x11()))
# rjd3toolkit::dictionary(rjd3toolkit::.jd3_object(jrslt, result = TRUE)) |>
# sort() |>
# dput()
sa_x11 = c("b1", "b10", "b11", "b13", "b17", "b2", "b20", "b3", "b4",
"b5", "b6", "b7", "b8", "b9", "c1", "c10", "c11", "c13", "c17",
"c2", "c20", "c4", "c5", "c6", "c7", "c9", "d1", "d10", "d11",
"d12", "d13", "d2", "d4", "d5", "d6", "d7", "d8", "d9", "d9-global-msr",
"d9-msr", "d9-msr-table", "seasonal-filters", "trend-filter",
"x11-all")
switch (x,
x13 = sa_x13,
regarima = sa_regarima,
x11 = sa_x11
)
}