jdemetra-app icon indicating copy to clipboard operation
jdemetra-app copied to clipboard

TSW+ to JDemetra+

Open luisjo819 opened this issue 5 years ago • 4 comments

Because of my job I have to translate de seasonal adjustment of series from TSW+ (Tramo/Seats software from Bank of Spain) to JDemetra+. Whenever I try to replicate the same parameters that are in TSW+ software for seasonal adjustments (RS4), the seasonal adjusted series is always different from the one from JDemetra+. In TSW+ I use the all the default settings excep RS4 for Procedure parameters, Log transformation, Easter effect of 3 days, and the introduction of two regresion variables (holidays and leap-year[February dummy] in an excel table) in the seasonal component. I try the same in JDemetra+ but the outputs are diferent in both softwares. Because of my job I need that both outputs to be the same. Is that possible? I thought that the core engines of “Tramo/Seats” from both software’s were the same. Please help me.

luisjo819 avatar Jun 26 '19 15:06 luisjo819

Hello,

The core engines are not the same and the results might be different (mainly due to some small discrepancies in the optimization procedure). However, in most cases they should be very similar. If you get systematically different results, the problem is probably elsewhere. You mention that you use RSA4 (which means, amongst other things, automatic detection of working days/leap year) + a leap year variable. That leads to redundant regression models (twice the leap-year) and could disturb the processing. Could you check the results if you suppress the leap year variable. If the problem persists, could you send me your TSW+ spec file and the settings you use in JD+.

palatej avatar Jun 27 '19 08:06 palatej

Dear Jean Palate:

The results are not the same for me. In particular, while in TSW + no significant effects are detected in the Easter regressor or TradingDays, in JDemetra + it detects them, and that modifies the output. When in JDemetra I annul the Easter regressor (Calendar / option = NONE) the results are very similar.

Below what I do in TSW +:

  1. I enter the series PBI.xlsx as Input, and open Models ++. ITER = 2.
  2. I put RS4 (by default) and in ARIMA MODEL I put LAM = 0.
  3. In OTHERS I put IEAST = 1 with IDUR = 3.
  4. I put IREG = 2, I put OK, and then in the following screen:
  5. ISUERS = -1, NSER = 2, ILONG = 87, and Regeff = 2 for both variables.
  6. Charge the feriados.xlsx in Regression and Ok (holidays and leap year).
  7. I put RUN. (I attach the parameters obtained as model.txt).

In JDemetra+, instead, I use the tramoseats specification that I attach as a “configuracion Jdemetra.cfgx" with the variables that I attach as "variables.cfgx" (which are the same as feriados.xlsx).

The outputs of both softwares are diferent. In addition, the Easter regressor is detected for all the variables (while in TSW + it does not), and in some the TD effect.

My question is, what are these differences due to? In my area we are interested in incorporating JDemetra + to deseasonalise series, but to do so, I need to expose why both softwares give different results.

Thank you in advance for your help! Greetings from Peru!

Luis Jose Zapata Bobadilla

From: Jean Palatemailto:[email protected] Sent: jueves, 27 de junio de 2019 03:28 To: jdemetra/jdemetra-appmailto:[email protected] Cc: luisjo819mailto:[email protected]; Authormailto:[email protected] Subject: Re: [jdemetra/jdemetra-app] TSW+ to JDemetra+ (#461)

Hello,

The core engines are not the same and the results might be different (mainly due to some small discrepancies in the optimization procedure). However, in most cases they should be very similar. If you get systematically different results, the problem is probably elsewhere. You mention that you use RSA4 (which means, amongst other things, automatic detection of working days/leap year) + a leap year variable. That leads to redundant regression models (twice the leap-year) and could disturb the processing. Could you check the results if you suppress the leap year variable. If the problem persists, could you send me your TSW+ spec file and the settings you use in JD+.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/jdemetra/jdemetra-app/issues/461?email_source=notifications&email_token=AMONJK7EDVWUTDAJKXSPKDTP4R2ZXA5CNFSM4H3TUIA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYWLTVI#issuecomment-506247637, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMONJKY2CMFBNZR244TC5GLP4R2ZXANCNFSM4H3TUIAQ.

"PBI Global" $Input Lamchanged=False,Fh=24,Rsa=0,Iatip=1,Idur=3,Int1=87,NZ0=87,Lamchanged=False,Lam=0,P=1,D=0,Q=0,Fh=24,Rsa=0,Iatip=1,Idur=3,Ireg=2,Itrad=1, $End $Reg Iuser =-1,Regeff(1) =2,Regeff(2) =2,Ilong =87,Nser =2, $End 0 0 0 1 0 0 0 0 1 0 1 0 0 0 1 0 0 0 3 0 1 0 3 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 3 0 1 0 0 0 0 0 0 0 1 0 0 0 2 0 0 0 0 0 1 0 0 0 3 0 1 0 0 0 0 0 0 0 1 0 1 0 2 0 0 0 0 0 1 0 0 0 3 0 1 0 0 1 0 0 0 0 0 0 1 0 2 0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 2 0 1 0 0 0 0 0 1 0 2 0 2 0 0 0 0 0 0 0 1 0 1 0 3 0 2 0 0 0 1 0 2 0 2 0 1 0 0 0 0 0 "PBI Primario" $Input Lamchanged=False,Fh=24,Rsa=0,Iatip=1,Idur=3,Int1=87,NZ0=87,Lamchanged=False,Lam=0,P=1,D=0,Q=0,Fh=24,Rsa=0,Iatip=1,Idur=3,Ireg=2, $End $Reg Iuser =-1,Regeff(1) =2,Regeff(2) =2,Ilong =87,Nser =2, $End 0 0 0 1 0 0 0 0 1 0 1 0 0 0 1 0 0 0 3 0 1 0 3 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 3 0 1 0 0 0 0 0 0 0 1 0 0 0 2 0 0 0 0 0 1 0 0 0 3 0 1 0 0 0 0 0 0 0 1 0 1 0 2 0 0 0 0 0 1 0 0 0 3 0 1 0 0 1 0 0 0 0 0 0 1 0 2 0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 2 0 1 0 0 0 0 0 1 0 2 0 2 0 0 0 0 0 0 0 1 0 1 0 3 0 2 0 0 0 1 0 2 0 2 0 1 0 0 0 0 0 "PBI No Primario" $Input Lamchanged=False,Fh=24,Rsa=0,Iatip=1,Idur=3,Int1=87,NZ0=87,Lamchanged=False,Lam=0,Imean=0,P=2,Q=0,Fh=24,Rsa=0,Iatip=1,Idur=3,Ireg=4, $End $Reg Iuser =-1,Regeff(1) =2,Regeff(2) =2,Ilong =87,Nser =2, $End 0 0 0 1 0 0 0 0 1 0 1 0 0 0 1 0 0 0 3 0 1 0 3 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 3 0 1 0 0 0 0 0 0 0 1 0 0 0 2 0 0 0 0 0 1 0 0 0 3 0 1 0 0 0 0 0 0 0 1 0 1 0 2 0 0 0 0 0 1 0 0 0 3 0 1 0 0 1 0 0 0 0 0 0 1 0 2 0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 2 0 1 0 0 0 0 0 1 0 2 0 2 0 0 0 0 0 0 0 1 0 1 0 3 0 2 0 0 0 1 0 2 0 2 0 1 0 0 0 0 0 $Reg Iuser =2,Nser =2, $End 64 AO 4 AO

luisjo819 avatar Jun 27 '19 22:06 luisjo819

Hola Luis José,

Thanks a lot for your explanations. If JDemetra+ finds significant calendar effects (related to Easter or Trading days), it is very likely that they exist in reality. The question is, why doesn't your TSW+ specification find them? We cannot get inside the TSW+ Fortran code to understand what happens, but we strongly suspect the problem occurs at the QR step: TSW+ probably fais to identify calendar effects because you are using two times the same regressor:

  • The option (2) RS4 you are using tests for calendar effects and in case they are significant, the sofware incorporates the corresponding calendar regressor in the model
  • The options (4-5-6) add calendar regressors using the information about Peruvian festivities avaiable in your input file feriados.xls
1) I enter the series PBI.xlsx as Input, and open Models ++. ITER = 2.
2) I put RS4 (by default) and in ARIMA MODEL I put LAM = 0.
3) In OTHERS I put IEAST = 1 with IDUR = 3.
4) I put IREG = 2, I put OK, and then in the following screen:
5) ISUERS = -1, NSER = 2, ILONG = 87, and Regeff = 2 for both variables.
6) Charge the feriados.xlsx in Regression and Ok (holidays and leap year).
7) I put RUN. (I attach the parameters obtained as model.txt).

In the case of JDemetra+, the algorithm realises that it's impossible to identify the coefficient associated to your calendar regressors (because they are identical). Thus, JDemetra+ eliminates one of them in order to circunvent the problem

To sum up:

  • If you eliminate the Easter regressor in JDemetra+ (Calendar / option = NONE) so that your results coincide with those of TSW+, you will not obtain a correct adjustment for calendar effects.
  • Your old procedures based on TSW+ use the option RS4 plus user suplied calendar regressors are likely to skip the calendar adjustment because of a problem at the QR step caused by perfect collinearity (i.e. redundant information). But in JDemetra+, the sofware knows you are adding redundant information, so it will simply ignore it, leading to an effective adjustment for calendar effects

Liedo avatar Jun 28 '19 10:06 Liedo

Thank you for your explanations. You were right that TSW+ doesnt recognize well significative calendar effects. I was able to identify it, and explain it in my job. Thank you very much, we are going to use JDemetra+ from now on.

luisjo819 avatar Jul 08 '19 15:07 luisjo819