Title: | Interface to the 'JWSACruncher' of 'JDemetra+' |
---|---|
Description: | 'JDemetra+' (<https://github.com/jdemetra/jdemetra-app>) is the seasonal adjustment software officially recommended to the members of the European Statistical System and the European System of Central Banks. Seasonal adjustment models performed with 'JDemetra+' can be stored into workspaces. 'JWSACruncher' (<https://github.com/jdemetra/jwsacruncher/releases>) is a console tool that re-estimates all the multi-processing defined in a workspace and to export the result. 'rjwsacruncher' allows to launch easily the 'JWSACruncher'. |
Authors: | Alain Quartier-la-Tente [aut, cre] , Institut national de la statistique et des études économiques [cph] |
Maintainer: | Alain Quartier-la-Tente <[email protected]> |
License: | GPL-3 |
Version: | 0.2.1 |
Built: | 2024-11-11 04:44:41 UTC |
Source: | https://github.com/AQLT/rjwsacruncher |
Function configure the 'JWSACruncher' with a portable version of 'Java'.
configure_jwsacruncher(jwsacruncher_path, java_path)
configure_jwsacruncher(jwsacruncher_path, java_path)
jwsacruncher_path |
Path to the file |
java_path |
Path to the file |
Since the version 2.2.0, the 'JWSACruncher' needs 'Java' 8 or higher to run. For versions 3.0.0 and higher, 'JWSACruncher' needs 'Java' 17 or higher. In 'Windows' versions 3.0.0 and higher of 'JWSACruncher' includes a portable version of 'Java'. For lower version of 'JWSACruncher', if you cannot install 'Java' (for example for security reasons) you can install a portable version of 'Java' (that does not require administrator rights) and configure the 'JWSACruncher' to use this portable version. To do it you have to:
Unzip the downloaded file of the 'JWSACruncher';
Open, with a Text Editor, the file jwsacruncher.bat
that is in the sub-folder /bin/
of the 'JWSACruncher';
Edit the line 71 that contains if "%JAVACMD%"=="" set JAVACMD=java
and replace java
by the path to the file java.exe
of the portable version. For example, if the portable
version of 'Java' is installed under D:/Software/Java
, the path to java.exe
should be at
D:/Software/Java/bin/java.exe
and the new line 71 would be
if "%JAVACMD%"=="" set JAVACMD="D:\Software\Java\bin\java.exe"
.
The function configure_jwsacruncher()
does the steps 2 and 3.
To run the 'JWSACruncher' needs a parameter file and create_param_file
allows to create it.
create_param_file( dir_file_param, bundle = 10000, csv_layout = "list", csv_separator = ";", ndecs = 6, full_series_name = TRUE, rslt_name_level = 2, policy = "parameters", refreshall = TRUE, output = NULL, matrix_item = getOption("default_matrix_item"), tsmatrix_series = getOption("default_tsmatrix_series"), paths_path = NULL, v3 = getOption("is_cruncher_v3") )
create_param_file( dir_file_param, bundle = 10000, csv_layout = "list", csv_separator = ";", ndecs = 6, full_series_name = TRUE, rslt_name_level = 2, policy = "parameters", refreshall = TRUE, output = NULL, matrix_item = getOption("default_matrix_item"), tsmatrix_series = getOption("default_tsmatrix_series"), paths_path = NULL, v3 = getOption("is_cruncher_v3") )
dir_file_param |
Path to the directory that will contains the parameter file |
bundle |
Maximum size for a group of series (in output). By default |
csv_layout |
Layout of the CSV files (series only). By default |
csv_separator |
The field separator string used in the CSV file. By default |
ndecs |
Number of decimals used in the output. By default |
full_series_name |
Boolean indicating if the fully qualified name of the series will be used (the default |
rslt_name_level |
Only used when |
policy |
Refreshing policy of the processing. By default |
refreshall |
Boolean indicating if the data is refreshed (by default |
output |
Full path of the output folder. By default ( |
matrix_item |
Character containing the items of the matrix output (see the 'JDemetra+' manual for more information). By default, the items defined in the option |
tsmatrix_series |
Character containing the names of the times series to export (see the 'JDemetra+' manual for more information). By default, the items defined in the option |
paths_path |
The paths used for relative addresses (see the "Demetra Paths" of the graphical interface of 'JDemetra+'). |
v3 |
Boolean indicating if the parameter file should be compatible with a version 3.0.0 and higher of 'JWSACRuncher' ( |
When the 'JWSACruncher' is launched, the data is refreshed with a specific policy that is defined by the parameter policy
. The available options are:
policy = "current"
: all the estimations are fixed;
policy = "fixedparameters"
or policy = "fixed"
: re-estimation of the coefficients of the regression variables (but not the ARIMA coefficients);
policy = "parameters"
(the default): policy = "fixedparameters"
+ re-estimation of ARIMA coefficients;
policy = "lastoutliers"
: policy = "parameters"
+ re-identification of last outliers (on the last year);
policy = "outliers"
: policy = "lastoutliers"
+ re-identification of all outliers;
policy = "stochastic"
: policy = "outliers"
+ re-identification of ARIMA orders;
policy = "complete"
or policy = "concurrent"
: the model is completely re-identified and re-estimated.
Path to the parameter file.
read_param_file()
, list2param_file()
, default_param_file cruncher_and_param()
.
## Not run: dir = tempdir() # Here a file parameters.param is created in the directory dir # with default parameters of the different options create_param_file(dir) # to only export the raw and the seasonally adjusted series create_param_file(dir, tsmatrix_series = c("y", "sa")) ## End(Not run)
## Not run: dir = tempdir() # Here a file parameters.param is created in the directory dir # with default parameters of the different options create_param_file(dir) # to only export the raw and the seasonally adjusted series create_param_file(dir, tsmatrix_series = c("y", "sa")) ## End(Not run)
Function to run the 'JWSACruncher' on a workspace from a parameter file.
cruncher( workspace, cruncher_bin_directory = getOption("cruncher_bin_directory"), param_file_path, log_file = NULL )
cruncher( workspace, cruncher_bin_directory = getOption("cruncher_bin_directory"), param_file_path, log_file = NULL )
workspace |
Path to the workspace. By default a dialog box opens to choose the workspace. |
cruncher_bin_directory |
Path to the "bin" directory of the 'JWSACruncher'. By default
the value of the option |
param_file_path |
Path to the parameter file of the 'JWSACruncher'. By default a .params file is search in the save directory of the workspace. |
log_file |
Name of the log file of 'JWSACruncher'. By default the log isn't exported. |
The path to the workspace.
Around the 'JWSACruncher': cruncher_and_param()
, update_workspace()
.
To create the parameter file: create_param_file()
and list2param_file()
.
## Not run: dir = tempdir() # First create a parameter file # here a file parameters.param is created in the directory dir # with default parameters of 'JWSACruncher' v2 list2param_file(dir, default_param_file(v3 = FALSE)) # If the option "cruncher_bin_directory" is correctly defined: cruncher("workspace.xml", param_file_path = file.path(dir, "parameters.param")) ## End(Not run)
## Not run: dir = tempdir() # First create a parameter file # here a file parameters.param is created in the directory dir # with default parameters of 'JWSACruncher' v2 list2param_file(dir, default_param_file(v3 = FALSE)) # If the option "cruncher_bin_directory" is correctly defined: cruncher("workspace.xml", param_file_path = file.path(dir, "parameters.param")) ## End(Not run)
Function to run the 'JWSACruncher' on a workspace while creating the parameter file.
cruncher_and_param( workspace = NULL, output = NULL, rename_multi_documents = FALSE, delete_existing_file = FALSE, log_file = NULL, cruncher_bin_directory = getOption("cruncher_bin_directory"), ... )
cruncher_and_param( workspace = NULL, output = NULL, rename_multi_documents = FALSE, delete_existing_file = FALSE, log_file = NULL, cruncher_bin_directory = getOption("cruncher_bin_directory"), ... )
workspace |
Path to the workspace. By default a dialog box opens to choose the workspace. |
output |
Full path of the output folder. By default ( |
rename_multi_documents |
Boolean indicating whether to rename the folders
containing the outputs according to the names of the multi-documents of the workspace.
By default |
delete_existing_file |
Only used if |
log_file |
Name of the log file of 'JWSACruncher'. By default the log isn't exported. |
cruncher_bin_directory |
Path to the "bin" directory of the 'JWSACruncher'. By default
the value of the option |
... |
Other parameters of |
Path to the workspace.
cruncher()
, update_workspace()
, create_param_file()
, multiprocessing_names()
.
Get default parameters of the 'JWSACruncher'
default_param_file(v3 = getOption("is_cruncher_v3"))
default_param_file(v3 = getOption("is_cruncher_v3"))
v3 |
Boolean indicating if the parameters are the from a version 3.0.0 and higher of 'JWSACRuncher' ( |
create_param_file()
, read_param_file()
, list2param_file()
, cruncher_and_param()
.
Function to download the ZIP file of the 'JWSACruncher'
download_cruncher( directory, cruncher_version, v3 = getOption("is_cruncher_v3") )
download_cruncher( directory, cruncher_version, v3 = getOption("is_cruncher_v3") )
directory |
Directory where to save the 'JWSACruncher'. In Windows, a dialog box opens by default to select the directory. |
cruncher_version |
Character of the version of the 'JWSACruncher' to download ("X.Y.Z" format). By default the last version is downloaded. |
v3 |
Boolean indicating, when parameter |
The 'JWSACruncher' is downloaded from https://github.com/jdemetra/jwsacruncher/releases for versions lower than 3.0.0 and from https://github.com/jdemetra/jdplus-main/releases for the other versions. To use it, it has to be unzip.
## Not run: # On Windows opens a dialog box to choose the directory where to # download the last version of the 'JWSACruncher' download_cruncher() dir <- tempdir() # To download the last release: download_cruncher(dir) # To download the release of the version 2.2.2: download_cruncher(dir, "2.2.2") ## End(Not run)
## Not run: # On Windows opens a dialog box to choose the directory where to # download the last version of the 'JWSACruncher' download_cruncher() dir <- tempdir() # To download the last release: download_cruncher(dir) # To download the release of the version 2.2.2: download_cruncher(dir, "2.2.2") ## End(Not run)
Create parameter file from list
list2param_file(dir_file_param, x)
list2param_file(dir_file_param, x)
dir_file_param |
Path to the directory that will contains the parameter file |
x |
A list, for example create by |
create_param_file()
, read_param_file()
, default_param_file()
cruncher_and_param()
.
## Not run: dir = tempdir() # Here a file parameters.param is created in the directory dir # with default parameters of 'JWSACruncher' v2 list_param <- default_param_file(v3 = FALSE) list2param_file(dir, list_param) # to only export the raw and the seasonally adjusted series list_param$tsmatrix_series <- c("y", "sa") list2param_file(dir, list_param) ## End(Not run)
## Not run: dir = tempdir() # Here a file parameters.param is created in the directory dir # with default parameters of 'JWSACruncher' v2 list_param <- default_param_file(v3 = FALSE) list2param_file(dir, list_param) # to only export the raw and the seasonally adjusted series list_param$tsmatrix_series <- c("y", "sa") list2param_file(dir, list_param) ## End(Not run)
Function to get the name of the multiprocessings that appears on 'JDemetra+' and the name of the corresponding XML file.
multiprocessing_names(workspace)
multiprocessing_names(workspace)
workspace |
Path to the workspace. By default a dialog box opens to choose the workspace. |
A data.frame
containing the name of the multiprocessings that appears on 'JDemetra+' (column name
) and
the name of the associated XML files (column file
).
Read parameter file of the 'JWSACruncher'
read_param_file(file)
read_param_file(file)
file |
Path to the parameter file. |
create_param_file()
, list2param_file()
, default_param_file()
cruncher_and_param()
.
dir = tempdir() list_param <- default_param_file(v3 = FALSE) list2param_file(dir, list_param) list_param_2 <- read_param_file(file.path(dir, "parameters.param")) all.equal(list_param, list_param_2)
dir = tempdir() list_param <- default_param_file(v3 = FALSE) list2param_file(dir, list_param) list_param_2 <- read_param_file(file.path(dir, "parameters.param")) all.equal(list_param, list_param_2)
Function to update a workspace without exporting the results.
update_workspace( workspace = NULL, policy = "parameters", cruncher_bin_directory = getOption("cruncher_bin_directory"), log_file = NULL )
update_workspace( workspace = NULL, policy = "parameters", cruncher_bin_directory = getOption("cruncher_bin_directory"), log_file = NULL )
workspace |
Path to the workspace. By default a dialog box opens to choose the workspace. |
policy |
Refreshing policy of the processing. By default |
cruncher_bin_directory |
Path to the "bin" directory of the 'JWSACruncher'. By default
the value of the option |
log_file |
Name of the log file of 'JWSACruncher'. By default the log isn't exported. |
Path to the workspace.
cruncher()
, cruncher_and_param()
.