turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Forecasting
- /
- ARIMA Transfer Functions

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted
# ARIMA Transfer Functions

Options

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-05-2017 03:27 PM

Hello SAS Procedures Community,

I would like assistance with syntax for specifying "Zero-Order" and "First-Order" transfer functions for interrupted time series ARIMA models. Specifically, what is the code I would use for: (1) the abrupt, permanent change (zero-order), versus (2) gradual, permanent change (first-order)? I am trying to compare pulse, zero-order, and first-order functions to determine if the introduction of a migration policy at point t (the year 2001) is characterized by a abrupt, temporary impact (pulse), an abrupt, permanent change (zero-order), or by a gradual, permanent change (first-order) on visa issuances.

I also wonder if the way I have the dates set up is correct, respectively? (I.e. what would be the temporary shock from 2002 to 2007? Or a permanent change after 2001?)

I'm very new to the ARIMA procedures and I have combed the SAS boards, guides, and examples for proper syntax. This is what I have come up with:

Pulse (temporary): where variable "temp" is coded as 0 prior to and after the event, and 1 during the temporary event ("000111000").

data a;

set a;

temp = (date = '2002'd, '2003'd, '2004'd, '2005'd, '2006'd, '2007'd);

run;

proc arima data=a;

identify var=f crosscorr=temp;

estimate p=1 q=1 input=temp;

run;

??? (permanent): where the variable "perm" is coded as 0 prior to the event (2001), and 1 after the event ("0000011111")

data a;

set a;

temp = (date >= '2002'd);

run;

proc arima data=a;

identify var=f crosscorr=perm;

estimate p =1 q=1 input=perm;

run;

Thank you all for helping a newbie, I appreciate all the help and feedback.

Accepted Solutions

Solution

07-11-2017
01:12 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-07-2017 04:06 PM

Hi KACJohnson,

You are definitely on the right track in terms of your understanding of abrupt temporary changes, as compared with abrupt permanent changes and gradual permanent changes. Temporary changes are typically modeled using a pulse intervention variable, whereas permanent effects are typically modeled using a step intervention variable. A pulse intervention takes on the value of 0 before and after the intervention, and 1 for the duration of the intervention. A step intervention typically takes on the value of 0 before the intervention and 1 afterwards.

An abrupt temporary effect can be modeled by including a pulse intervention variable as a simple regressor in the model. Similarly, an abrupt permanent effect can be modeled by including a step intervention variable as a simple regressor in the model. A gradual permanent effect can be modeled by including a step intervention variable as a dynamic regressor with a denominator factor in the transfer function part of the model.

Following, please find an example that illustrates how to fit these 3 types of intervention models. The example contains annual data from 1998-2010. Three additional years are included to illustrate how to use the models for forecasting. The example creates a SAS date variable, DATE, from the numeric YEAR variable, and then uses the DATE variable to create the pulse and step intervention variables included in the subsequent ARIMA models. I tried to keep these variables consistent with the description you provided for your analysis. Please note that in order to illustrate the impact of the intervention variables in this example, I have not specified any AR or MA terms in the ARIMA models, though you can certainly include the P= and/or Q= options in the ESTIMATE statement to model any residual autocorrelation.

```
data a;
input year y;
date=mdy(1,1,year); /* create SAS date variable from YEAR variable */
format date year4.;
datalines;
1998 10
1999 12
2000 12
2001 15
2002 16
2003 16
2004 17
2005 17
2006 17
2007 16
2008 17
2009 18
2010 17
2011 .
2012 .
2013 .
;
/* add step and pulse interventions to data set using DATE variable */
data a;
set a;
perm=(date >= '01jan2001'd);
temp=('01jan2002'd <= date <= '01jan2007'd);
run;
proc print data=a;
run;
/* abrupt temporary effect */
proc arima data=a plots=(forecast(forecast));
identify var=y crosscorr=(temp);
estimate input=(temp);
forecast out=out1 lead=3 id=date interval=year;
run;
quit;
/* abrupt permanent effect */
proc arima data=a plots=(forecast(forecast));
identify var=y crosscorr=(perm);
estimate input=(perm);
forecast out=out2 lead=3 id=date interval=year;
run;
quit;
/* gradual permanent effect */
proc arima data=a plots=(forecast(forecast));
identify var=y crosscorr=(perm);
estimate input=( /(1) perm);
forecast out=out3 lead=3 id=date interval=year;
run;
quit;
```

Note that when creating the intervention variables based on the values of the SAS date variable, DATE, you must use a SAS date literal of the form 'ddmonyy'd.

For more details on how to specify input variables and transfer function models in PROC ARIMA, please see the following section of the documentation:

I hope this information helps!

DW

All Replies

Solution

07-11-2017
01:12 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-07-2017 04:06 PM

Hi KACJohnson,

You are definitely on the right track in terms of your understanding of abrupt temporary changes, as compared with abrupt permanent changes and gradual permanent changes. Temporary changes are typically modeled using a pulse intervention variable, whereas permanent effects are typically modeled using a step intervention variable. A pulse intervention takes on the value of 0 before and after the intervention, and 1 for the duration of the intervention. A step intervention typically takes on the value of 0 before the intervention and 1 afterwards.

An abrupt temporary effect can be modeled by including a pulse intervention variable as a simple regressor in the model. Similarly, an abrupt permanent effect can be modeled by including a step intervention variable as a simple regressor in the model. A gradual permanent effect can be modeled by including a step intervention variable as a dynamic regressor with a denominator factor in the transfer function part of the model.

Following, please find an example that illustrates how to fit these 3 types of intervention models. The example contains annual data from 1998-2010. Three additional years are included to illustrate how to use the models for forecasting. The example creates a SAS date variable, DATE, from the numeric YEAR variable, and then uses the DATE variable to create the pulse and step intervention variables included in the subsequent ARIMA models. I tried to keep these variables consistent with the description you provided for your analysis. Please note that in order to illustrate the impact of the intervention variables in this example, I have not specified any AR or MA terms in the ARIMA models, though you can certainly include the P= and/or Q= options in the ESTIMATE statement to model any residual autocorrelation.

```
data a;
input year y;
date=mdy(1,1,year); /* create SAS date variable from YEAR variable */
format date year4.;
datalines;
1998 10
1999 12
2000 12
2001 15
2002 16
2003 16
2004 17
2005 17
2006 17
2007 16
2008 17
2009 18
2010 17
2011 .
2012 .
2013 .
;
/* add step and pulse interventions to data set using DATE variable */
data a;
set a;
perm=(date >= '01jan2001'd);
temp=('01jan2002'd <= date <= '01jan2007'd);
run;
proc print data=a;
run;
/* abrupt temporary effect */
proc arima data=a plots=(forecast(forecast));
identify var=y crosscorr=(temp);
estimate input=(temp);
forecast out=out1 lead=3 id=date interval=year;
run;
quit;
/* abrupt permanent effect */
proc arima data=a plots=(forecast(forecast));
identify var=y crosscorr=(perm);
estimate input=(perm);
forecast out=out2 lead=3 id=date interval=year;
run;
quit;
/* gradual permanent effect */
proc arima data=a plots=(forecast(forecast));
identify var=y crosscorr=(perm);
estimate input=( /(1) perm);
forecast out=out3 lead=3 id=date interval=year;
run;
quit;
```

Note that when creating the intervention variables based on the values of the SAS date variable, DATE, you must use a SAS date literal of the form 'ddmonyy'd.

For more details on how to specify input variables and transfer function models in PROC ARIMA, please see the following section of the documentation:

I hope this information helps!

DW

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

2 weeks ago

I wanted to post the code I ended up using so if others need it, too:

/* Abrupt permanent effect, zero-order transfer function */

proc arima data=arima;

identify var=logf(1) crosscorr=(perm);

estimate p=0 q=1 input=(perm);

run;

/* Gradual permanent effect, first-order transfer function */

proc arima data=arima;

identify var=logf(1) crosscorr=(perm);

estimate p=0 q=1 input=( /(1) perm);

run;

/* Abrupt temporary effect, pulse transfer function */

proc arima data=arima;

identify var=logf(1) crosscorr=(temp);

estimate p=0 q=1 input=( / (1) temp );

run;