christophsax / seasonal Goto Github PK
View Code? Open in Web Editor NEWR interface to X-13ARIMA-SEATS
Home Page: www.seasonal.website
R interface to X-13ARIMA-SEATS
Home Page: www.seasonal.website
R error handling instead of X13
x <- seas(AirPassengers, x11.type = "trend")
static(x, test = F)
# temporary and permanent adjustment
cpi <- ts(runif(250), start = c(1945, 1), frequency = 12)
strike <- ts(runif(250), start = c(1945, 1), frequency = 12)
m <- seas(AirPassengers,
transform.xreg = cbind(cpi, strike),
transform.type = c("temporary", "permanent"),
transform.function = "log"
)
with possible re-evaluation
do some speed tests: how much time uses reading spectrum data by default?
probably a x13 issue, it happens when seas is combined with transform.function = log.
in inspect, warnings should be returned immediately and not after quitting the function
revisions
save all available output.series { data = (879 899 462 670 985 973 ...)
start = 1967.jan }
transform{data =(1 1.5.75 1 1...) mode = ratio
adjust = lom }
# transform
tf <- rnorm(144)
AirPassengers.tf <- AirPassengers * tf
m <- seas(AirPassengers,
AirPassengers.tf
)
# transform back
final(m) / tf
The history spec leads to questionable figures. The following four models do not greatly differ but history treats them very different. It has something to do with the log, but also with x11/seats. The final series in the x$sae
element ist also not identifiable in the mode. Need for inquiry. Delays history spec.
library(seasonal)
m1 <- seas(x = AirPassengers, arima.model = "(0 1 1)(0 1 1)",
regression.aictest = NULL, outlier = NULL,
transform.function = "log")
m2 <- seas(x = AirPassengers, arima.model = "(0 1 1)(0 1 1)",
regression.aictest = NULL, outlier = NULL,
transform.function = "none")
m3 <- seas(x = AirPassengers, arima.model = "(0 1 1)(0 1 1)",
regression.aictest = NULL, outlier = NULL,
transform.function = "log", x11 = list())
m4 <- seas(x = AirPassengers, arima.model = "(0 1 1)(0 1 1)",
regression.aictest = NULL, outlier = NULL,
transform.function = "none", x11 = list())
r1 <- revisions(m1)
r2 <- revisions(m2)
r3 <- revisions(m3)
r4 <- revisions(m4)
ts.plot(r1$sae, col = c("black", "red"))
ts.plot(r2$sae, col = c("black", "red"))
ts.plot(r3$sae, col = c("black", "red"))
ts.plot(r4$sae, col = c("black", "red"))
texreg S4 method for seasonal is implemented, but it is unclear how a method definition for an outside function should work.
Currently, x11regression and regression are mutually exclusive. That should be changed.
series{ title = "Automobile Sales"
file = "carsales.dat"
start = 1975.Jan }
transform{ function = log }
regression{ variables = (const)
user = (strike80 strike85 strike90)
file = "strike.dat"
format = "(3f12.0)" }
arima{ model = (0 1 1)(0 1 1)12 }
x11{ title = ("Car Sales in US"
"Adjust for strikes in 80, 85, 90")
save = seasonal appendfcst = yes
}
x11regression{ variables = ( td easter[8] ) }
when solved, update wiki
This should also show the model:
> seas(AirPassengers, arima.model = c(2, 1, 1, 0, 2, 0))
Warning in seas(AirPassengers, arima.model = c(2, 1, 1, 0, 2, 0)) :
Model used for SEATS decomposition is different:
a comprehensive list of useful statistics should be shown
probably also affects other non standard freq. needs testing
# bimonthly data
require(tempdisagg)
AirPassengersBM <- ta(AirPassengers, to = 6)
m <- seas(AirPassengersBM,
regression.aictest = NULL,
outlier.types = c("ao", "ls", "tc"),
forecast.maxlead = 18
)
final(m) should return bimonthly data
X-13 has support for internal missing values, could be included in seasonal
model selection
graphical outlier deselection?
New plots
content of series help with comments should be sufficient
one help page for plots, one for diagnostical statistics
with numeric model input, the nonseasonal part is used as the seasonal part:
m1 <- seas(AirPassengers, arima.model = c(2, 1, 1, 0, 0, 0))
m2 <- seas(AirPassengers, arima.model = "(2 1 1)(0 0 0)")
identical(spc(m1), spc(m2))
The underlying function as.character.arima
is to blame:
> as.character.arima(c(3, 3, 2, 1, 3, 3))
[1] "(3 3 2)(3 3 2)"
> seasonal:::as.character.arima(c(2, 1, 1, 0, 0, 0))
[1] "(2 1 1)(2 1 1)"
> seasonal:::as.character.arima(c(2, 2, 1, 0, 0, 2))
[1] "(2 2 1)(2 2 1)"
> seasonal:::as.character.arima(c(2, 1, 1, 2, 0, 0))
[1] "(2 1 1)(2 1 1)"
> seasonal:::as.character.arima(c(2, 1, 1, 0, 1, 0))
[1] "(2 1 1)(2 1 1)"
> seasonal:::as.character.arima(c(2, 1, 1, 0, 1, 0))
[1] "(2 1 1)(2 1 1)"
> seasonal:::as.character.arima(c(2, 1, 1))
[1] "(2 1 1)"
seas(AirPassengers,
transform.function = "log",
arima.model = c(0, 1, 2, 0, 1, 1),
x11 = list()
)
this should be possible as an alternative to
seas(AirPassengers,
transform.function = "log",
arima.model = "(0 1 2)(0 1 1)",
x11 = list()
)
Add support for user defined variables
Add support for mts objects
For an unknown X-13-ARIMA SEATS related reason, the regressors in the x11regression
spec do not apperar in the output.
seas(AirPassengers,
x11regression.variables = c("td/1950.1/", "easter[8]",
"labor[10]", "thank[10]"),
x11.seasonalma = "x11default",
x11.sigmalim = c(1.8, 2.9),
x11.appendfcst = "yes",
)
when solved, update wiki
investigate whether the residual statistics in the summary are appropriate
suggestion by @mbannert:
use transform.function = "none"
if series has negative values to avoid x13 error
use of defaults and the dots should be better explained.
otherwise, no change in usage
if x13 is installed in a folder with a space in the name, e.g c:\prsgram files\blabla
, run_x13
does not work.
perhaps, the identify function could be used to unselect (or perhaps select) outliers in a plot
function
rather than explicitly import series from x-13, it would be more flexible to import all produced time series. Like that:
read_series
)installation, see readme (instead of 'included')
slidingspans
recalls seas
with activated slidingspans spec. returns object of class slidingspans
.
print.slidingspans
shows the output section.
plot.slidingspans
gives a nice overview of the 4 (or more) spans. Perhaps also a second panel with max. deviations.
x11 or seas
set up a testing routine for new releases
inst/tests
data
)A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.