BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
gumlese
Fluorite | Level 6

Hello SAS Community, 

 

I am using the TRAMO/SEATS component of the SAS ETS X13 procedure to attempt to extract the long term trend from a time series. However, SAS combines the trend and cycle together in the output. In getting the trend-cycle, both the trend and cycle would have to be extracted through SEATS but these separate series are not provided in the output. Is there an undocumented option to get this output, or some way to access the working sets prior to the output to grab these series?

 

It's my first time posting so forgive me if I forget standards, I'm happy to answer any follow up questions if it helps you answer my question.

 

If it helps, here is my code so far:

proc x13 data=data date=date interval=qtr  ;
	var series;
	transform function=auto; 
	automdl maxdiff=(1,1) maxorder=(4,1);
	outlier;
	seatsdecomp out=output;
run;

Thanks,

 

Sean

1 ACCEPTED SOLUTION

Accepted Solutions
TammyJackson
SAS Employee

Sean,

 

Here are my thoughts about your question:

  • The SEATS method implemented in X13 is experimental. The warning written to the log reads as follows:

 

WARNING: This is an experimental release of the SEATSDECOMP statement. It has not had the same

         level of testing as other components of the SAS system.

 

Validating code is the most difficult part of the software development process. Often there is little or no software validation done for software that is freely available. The SEATS method in X13 has not yet been validated to our usual standards.

 

  • The version of SEATS used in the SAS method does not seem to make the cycle component available to the user; it is a version prior to the 2014 version that is referenced in the paper:

 

http://www.bde.es/f/webbde/SES/servicio/Programas_estadisticos_y_econometricos/Programas/ficheros/TS...

 

The documentation for the version of SEATS that was used to produce the SEATSDECOMP statement is:

 

Gómez, V., and Maravall, A. (1997b). Programs TRAMO and SEATS: Instructions for the User, Beta Version. Madrid: Banco de España.

 

In this document, there are numerous references to splitting the trend and cycle component into different series. However, in examining the printed output from the program, I only see references to a TREND-CYCLE series. In addition, in the SEATS documentation, there are references to output files cycle.t and cyclefac.t. Looking at the files produced by numerous runs of the SEATS FORTRAN program, I only see one file cycle.t, and it is associated with a run that caused a core dump – the program failed to run to completion.  This appears to be a situation where the documentation did not accurately describe the features of the software.  The fact that the trend cycle was not available in the older version seems to be confirmed by the 2014 article.

 

  • For the initial implementation of the method in SAS, the most basic output was selected to be output, and that consists of the series for the Original, Seasonal, Trend-Cycle, Seasonally Adjusted, and Irregular components. These are the series output at the end of the program and are described as the basic output by the documentation. Outputting the Trend-Cycle series is also consistent with X13 Table D12, which is the trend-cycle component. Also, the main purpose of the X13 software is to obtain a seasonally adjusted series.

 

  • Since the X-13ARIMA-SEATS program of the U.S. Census Bureau allows the Trend and Cycle to be decomposed separately by specifying HPCYCLE, this could be considered for a future release of the X13 procedure.

 

  • If you have a specific need for decomposing the series into separate trend and cycle components, then there are several methods available in SAS that use the Hodrick-Prescott filter:
    • The DECOMP statement in the TIMESERIES procedure.
    • The TRANSFORMIN= and TRANSFORMOUT= options HP_C and HP_T in the EXPAND procedure. 

 

 

Both the EXPAND and TIMESERIES procedure should provide reliable, high quality output. Also, it is easy to output series from one SAS procedure and input the series into another procedure. So, for instance, the B1 series from X13 could be used as input for the TIMESERIES procedure, or the TREND-CYCLE component could be used as input to the EXPAND procedure.

 

 

 

  • It is also possible to execute FORTRAN code from SAS, if you would prefer to do that. However, FORTRAN will compute on undefined values. For example, the calculations do not stop when a divide by zero occurs or a floating point overflow. Thus, inaccurate calculations in FORTRAN are often hidden from the user.

Thank you for supplying your data. We will add the data to our test validation code for the X13 procedure. If you have any further questions, please let me know.

 

View solution in original post

4 REPLIES 4
TammyJackson
SAS Employee

Hi Sean,

 

I am looking in to this. It would be helpful to have your data.

Thanks.

gumlese
Fluorite | Level 6

Hey Tammy,

 

I've been using the Australian Bureau of Statistic's employment by industry release, specifically for Agriculture, Forestry and Fishing and its child series Agriculture. I've attached my data set of the two quarterly raw series.

 

I also found this update notes to TRAMO/SEATS that talks about the decomposition of the trend-cycle into its business cycle and long-term trend components. Maybe this feature is not yet available in the SAS X-13 package.

 

Sean

TammyJackson
SAS Employee

Sean,

 

Here are my thoughts about your question:

  • The SEATS method implemented in X13 is experimental. The warning written to the log reads as follows:

 

WARNING: This is an experimental release of the SEATSDECOMP statement. It has not had the same

         level of testing as other components of the SAS system.

 

Validating code is the most difficult part of the software development process. Often there is little or no software validation done for software that is freely available. The SEATS method in X13 has not yet been validated to our usual standards.

 

  • The version of SEATS used in the SAS method does not seem to make the cycle component available to the user; it is a version prior to the 2014 version that is referenced in the paper:

 

http://www.bde.es/f/webbde/SES/servicio/Programas_estadisticos_y_econometricos/Programas/ficheros/TS...

 

The documentation for the version of SEATS that was used to produce the SEATSDECOMP statement is:

 

Gómez, V., and Maravall, A. (1997b). Programs TRAMO and SEATS: Instructions for the User, Beta Version. Madrid: Banco de España.

 

In this document, there are numerous references to splitting the trend and cycle component into different series. However, in examining the printed output from the program, I only see references to a TREND-CYCLE series. In addition, in the SEATS documentation, there are references to output files cycle.t and cyclefac.t. Looking at the files produced by numerous runs of the SEATS FORTRAN program, I only see one file cycle.t, and it is associated with a run that caused a core dump – the program failed to run to completion.  This appears to be a situation where the documentation did not accurately describe the features of the software.  The fact that the trend cycle was not available in the older version seems to be confirmed by the 2014 article.

 

  • For the initial implementation of the method in SAS, the most basic output was selected to be output, and that consists of the series for the Original, Seasonal, Trend-Cycle, Seasonally Adjusted, and Irregular components. These are the series output at the end of the program and are described as the basic output by the documentation. Outputting the Trend-Cycle series is also consistent with X13 Table D12, which is the trend-cycle component. Also, the main purpose of the X13 software is to obtain a seasonally adjusted series.

 

  • Since the X-13ARIMA-SEATS program of the U.S. Census Bureau allows the Trend and Cycle to be decomposed separately by specifying HPCYCLE, this could be considered for a future release of the X13 procedure.

 

  • If you have a specific need for decomposing the series into separate trend and cycle components, then there are several methods available in SAS that use the Hodrick-Prescott filter:
    • The DECOMP statement in the TIMESERIES procedure.
    • The TRANSFORMIN= and TRANSFORMOUT= options HP_C and HP_T in the EXPAND procedure. 

 

 

Both the EXPAND and TIMESERIES procedure should provide reliable, high quality output. Also, it is easy to output series from one SAS procedure and input the series into another procedure. So, for instance, the B1 series from X13 could be used as input for the TIMESERIES procedure, or the TREND-CYCLE component could be used as input to the EXPAND procedure.

 

 

 

  • It is also possible to execute FORTRAN code from SAS, if you would prefer to do that. However, FORTRAN will compute on undefined values. For example, the calculations do not stop when a divide by zero occurs or a floating point overflow. Thus, inaccurate calculations in FORTRAN are often hidden from the user.

Thank you for supplying your data. We will add the data to our test validation code for the X13 procedure. If you have any further questions, please let me know.

 

gumlese
Fluorite | Level 6
Thanks Tammy, I couldn't have hoped for a better response! I'll try those alternatives.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1963 views
  • 2 likes
  • 2 in conversation