Allin
My apologies. I had intended saving yesterday's draft reply and
revising and finishing the email today. It appears that, instead, I
sent it in error. Perhaps the best thing to do is ignore yesterday's
and read what is below?
Page 2 of the X12 manual states "Observations must be equally spaced
in time, and missing values are not allowed. As you say there are
circumstances in which -99999 can be used as an indicator of a missing
value. However this is not true in all cases. If I insert and
interior -99999 in Henrique's dataset (Jan 2010). }. The error message is
ERROR: Multiplicative or log additive seasonal adjustment cannot be
performed when preadjustment factors are derived from a regARIMA
model for data which have not been log transformed.
Check the values for the power or function arguments of the
transform spec and mode of the x11 spec.
There would appear to be some problem in the use of this code and the
defaults of automdl{} and x11{}. I presume that the message implies
that the x11{} spec is trying the default multiplicative adjustment
but the regARIMA step was completed using levels of the variables.
The spec passed to X12-ARIMA was
series{
period=12
title="teste1"
start=2001.1
data=(
2.44242 2.06569 2.7564 2.32389 2.58068 2.35682 2.4838
2.56693 2.0246 2.23309 1.95265 1.5527 1.91115 1.75875
1.7979 1.99489 1.90233 1.80959 2.41727 2.06787 1.99527
2.14675 1.94359 1.70031 1.94852 1.93438 1.9655 2.02454
2.15763 1.91898 2.25941 2.05011 2.43538 2.55376 2.31279
2.26303 2.3231 2.04155 3.01209 2.41058 2.41362 2.95703
2.91066 3.04607 3.1909 3.04472 3.21475 2.9296 2.88241
2.5542 3.104 2.876 3.147 3.41 3.229 3.785
3.162 3.079 3.342 3.18 3.331 2.964 3.708
3.242 3.549 3.55 4.078 4.558 4.125 4.354
4.053 3.61378 4.221 3.702 4.743 4.115 4.946
4.698 5.276 5.888 5.091 6.045 5.632 4.974
6.429 6.014 4.601 5.859 7.254 7.477 8.122
8.026 8.297 8.43 6.772 5.153 4.883 3.752
4.406 3.819 4.286 4.68 5.452 5.42 5.843
6.113 5.605 5.441 -99999 5.629 7.231 6.318
6.55 6.725 7.534 )
}
automdl{}
x11{ save=( d11 d12 d13 ) }
I can complete the analysis with the following amended spec.
series{
period=12
title="teste3"
start=2001.1
data=(
2.44242 2.06569 2.7564 2.32389 2.58068 2.35682 2.4838
2.56693 2.0246 2.23309 1.95265 1.5527 1.91115 1.75875
1.7979 1.99489 1.90233 1.80959 2.41727 2.06787 1.99527
2.14675 1.94359 1.70031 1.94852 1.93438 1.9655 2.02454
2.15763 1.91898 2.25941 2.05011 2.43538 2.55376 2.31279
2.26303 2.3231 2.04155 3.01209 2.41058 2.41362 2.95703
2.91066 3.04607 3.1909 3.04472 3.21475 2.9296 2.88241
2.5542 3.104 2.876 3.147 3.41 3.229 3.785
3.162 3.079 3.342 3.18 3.331 2.964 3.708
3.242 3.549 3.55 4.078 4.558 4.125 4.354
4.053 3.61378 4.221 3.702 4.743 4.115 4.946
4.698 5.276 5.888 5.091 6.045 5.632 4.974
6.429 6.014 4.601 5.859 7.254 7.477 8.122
8.026 8.297 8.43 6.772 5.153 4.883 3.752
4.406 3.819 4.286 4.68 5.452 5.42 5.843
6.113 5.605 5.441 -99999 5.629 7.231 6.318
6.55 6.725 7.534 )
}
transform{function=auto}
outlier{}
regression{variables=(const, td)}
automdl{}
x11{ save=( d11 ) }
Here the spec transform{function=auto} selects levels or log
transformation on the basis of AICC. In this case it selects a log
transformation ( transform{function=log} would give the the same
result). Now the automdl{} is estimating a model based on the
regARIMA log of the data which can be used in a multiplicative
(default) x11{} estimation. I have also chosen to include trading day
adjustment and adjustment for outliers in the model. If the trading
day adjustment is not done there are warnings about significant
trading day effects not being included. I also think that the outlier
adjustment is often important.
Is it possible to have an interface to X12-Arima similar to that for a
TRAMO/SEATS adjustment? I think that this should only cover the
minimum options necessary to produce a reasonable "automatic"
adjustment. I am sure that there are others who may have different
opinions on what is important. It would be interesting to hear their
opinions. The following is a provisional list containing three
possible tabs in such a facility.
1) Functional form
- no transformation (additive adjustment) - add
transform{function=none} (If this is done it is necessary to change
the adjustment process to additive in the x11{} spec)
- log transformation (multiplicative adjustment) - add
transform{function = log} to spec
- decided by x12-arima on basis of AIC - add transform{function =
auto} to spec (proposed Gretl default)
2) Adjust for outliers
- Use X12-ARIMA defaults - add outlier{} to spec (proposed Gretl default)
- Do not adjust for outliers
3) Trading day
- Include trading day adjustment - add regression{variables = td}
- Do not include trading day effect (Gretl default as trading day
adjustment is appropriate for flow data)
4) Missing values. (This was my initial way around the -99999 error
but it may not be necessary if transform{function = auto} is
included in the spec
- If missing values are present code them as 999999 (instead of
-99999) and add missingcode=999999 to the series spec.
- If the series contains interior non-numeric data or a Gretl
missing value code
There are many other options that might br considered. The inclusion
of many of these would over complicate the interface. It is probably
better to deal with the difficult cases by direct use of the X12-ARIMA
program. Gretl already provides the first step to such analysis as the
the X12-AEIMA spec file, .err file and other X12-ARIMA files have been
saved in C:\Users\username\AppData\Roaming\gretl\x12arima in windows 7
and probably in the corresponding subdirectory in Linux. The .err
file contains a quick summary of errors and warnings. The spec (.spc)
file can be edited used for the examination of the effect of other
options in the X12-ARIMA program.
I hope that I have not misunderstood some aspects of the recent
versions of the X12-ARIMA program
Best Regards
John
On 10 September 2010 00:12, Allin Cottrell <cottrell(a)wfu.edu> wrote:
On Thu, 9 Sep 2010, John C Frain wrote:
> My initial encounter with seasonal adjustment was as a
> statistician in the Central Statistics Office in Dublin...
Thanks, John, for presenting the expert's view!
Although I recently conceded to Henrique's request to trim leading
and trailing NAs from the sample passed to X-12-ARIMA, the reason
I hadn't done that before was that I had the idea that x12a could
handle missing values, if they were given as -9999 (or -99999?).
In your previous posting you said,
"While the X12-ARIMA manual states that missing values are not
allowed there are ways around this. If the missing value is
replaced by -99999 then -99999 may be replaced by a value that is
regarded as an outlier and then this may be replace by the
appropriate Reg-ARIMA fitted value for the purpose of estimation
seasonal factors etc. This may require specific X12ARIMA options
to be in effect and running X12-ARIMA outside of Gretl."
This gives me a general notion, but not enough in the way of
specifics to correct my previous (mis-)conception. Do you know of
a specific option that can be passed to x12a to get it to
interpret -99999 as missing? If so, that could easily be added to
gretl's invocation of the program.
As regards gretl native code, as you noted we don't accept
interior missing values for any dynamic time-series estimators.
This is more restrictive than it needs to be: our native Kalman
filter can handle NAs, and so our native AR(I)MA (which uses
Kalman) should also be able to handle them. But so far this
remains on the TODO list (on which there are many other things).
Allin
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
--
John C Frain
Economics Department
Trinity College Dublin
Dublin 2
Ireland
www.tcd.ie/Economics/staff/frainj/home.html
mailto:frainj@tcd.ie
mailto:frainj@gmail.com