Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

save_spec

Saving and loading a model specification, SA and pre-adjustment in X13 and TRAMO-SEATS


Description

save_spec saves a SA or RegARIMA model specification. load_spec loads the previously saved model specification.

Usage

save_spec(object, file = file.path(tempdir(), "spec.RData"))

load_spec(file = "spec.RData")

Arguments

object

object of one of the classes: c("SA_spec","X13"), c("SA_spec","TRAMO_SEATS"), c("SA","X13"), c("SA","TRAMO_SEATS"), c("regarima_spec","X13"), c("regarima_spec","TRAMO_SEATS"), c("regarima","X13"), c("regarima","TRAMO_SEATS").

file

(path and) name of the file where the model specification will be saved (have been saved).

Details

save_spec saves the final model specification of a "SA_spec", "SA", "regarima_spec" or "regarima" class object. load_spec loads the previously saved model specification. It creates a c("SA_spec","X13"), c("sA_spec","TRAMO_SEATS"), c("regarima_spec","X13") or c("regarima_spec","TRAMO_SEATS") class object, in line with the class of the previously saved model specification.

Value

load_spec returns an object of class "SA_spec" or "regarima_spec".

References

Info on JDemtra+, usage and functions: https://ec.europa.eu/eurostat/cros/content/documentation_en

Examples

myseries <- ipi_c_eu[, "FR"]
myreg1 <- regarima_x13(myseries, spec = "RG5c")
myspec2 <- regarima_spec_x13(myreg1, estimate.from = "2005-10-01", outlier.from = "2010-03-01")
myreg2 <- regarima(myseries, myspec2)

myreg3 <- regarima_tramoseats(myseries, spec = "TRfull")
myspec4 <-regarima_spec_tramoseats(myreg3, tradingdays.mauto = "Unused",
                                  tradingdays.option ="WorkingDays",
                                  easter.type = "Standard",
                                  automdl.enabled = FALSE, arima.mu = TRUE)
myreg4 <-regarima(myseries, myspec4)

myspec6 <- x13_spec("RSA5c")
mysa6 <- x13(myseries, myspec6)

myspec7 <- tramoseats_spec("RSAfull")
mysa7 <- tramoseats(myseries, myspec7)

dir <- tempdir()

 # Save the model specification from a c("regarima_spec","X13") class object
save_spec(myspec2, file.path(dir, "specx13.RData"))
 # Save the model specification from a c("regarima","X13") class object
save_spec(myreg2, file.path(dir,"regx13.RData"))
 # Save the model specification from a c("regarima_spec","TRAMO_SEATS") class object
save_spec(myspec4, file.path(dir,"specTS.RData"))
 # Save the model specification from a c("regarima","TRAMO_SEATS") class object
save_spec(myreg4, file.path(dir,"regTS.RData"))
 # Save model from a c("SA_spec","X13") class object
save_spec(myspec6, file.path(dir,"specFullx13.RData"))
 # Save model from a c("SA","X13") class object
save_spec(mysa6, file.path(dir,"sax13.RData"))
 # Save model from a c("SA_spec","TRAMO_SEATS") class object
save_spec(myspec7, file.path(dir,"specFullTS.RData"))
 # Save model from a c("SA","TRAMO_SEATS") class object
save_spec(mysa7, file.path(dir,"saTS.RData"))

 # Load the model specification
myspec2a <- load_spec(file.path(dir,"specx13.RData"))
myspec2b <- load_spec(file.path(dir,"regx13.RData"))
myspec4a <- load_spec(file.path(dir,"specTS.RData"))
myspec4b <- load_spec(file.path(dir,"regTS.RData"))
myspec6a <- load_spec(file.path(dir,"specFullx13.RData"))
myspec6b <- load_spec(file.path(dir,"sax13.RData"))
myspec7a <- load_spec(file.path(dir,"specFullTS.RData"))
myspec7b <- load_spec(file.path(dir,"saTS.RData"))


regarima(myseries, myspec2a)
x13(myseries, myspec6a)
tramoseats(myseries, myspec7a)

regarima(myseries, myspec4a)
x13(myseries, myspec6b)
tramoseats(myseries, myspec7b)

RJDemetra

Interface to 'JDemetra+' Seasonal Adjustment Software

v0.1.6
EUPL
Authors
Alain Quartier-la-Tente [aut, cre] (<https://orcid.org/0000-0001-7890-3857>), Anna Michalek [aut], Jean Palate [aut], Raf Baeyens [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.