Forecasting using SAS Forecast Server, SAS/ETS, and more

Unobserved Components Model

Accepted Solution Solved
Reply
Contributor
Posts: 24
Accepted Solution

Unobserved Components Model

I have annual time series data for 54 years. I am trying to estimate the Unobserved Components Model.

first I import the data using the option

file

Import Data

then I use the command

Print data -> Proc print data= file name

I run the UCM using the command

proc ucm data=filename; id year interval=year; model variable; irregular; level; slope; estimate;run;.


However I get the error "the id value at observation number 2 is invalid. I am able to run UCM for the help datafile in SAS (SeriesG air) but not for my actual data

Thank you in advance                                                                       


Accepted Solutions
Solution
‎09-25-2015 06:23 AM
SAS Employee
Posts: 49

Re: Unobserved Components Model

Identifying cycles can be tricky.  High frequency cycle can be masked by an irregular component and low frequency cycle can get masked by a flexible trend.  I am not sure why you are using two cycle statements.  Do you think there are multiple cycles?  UCM does permit you to control all aspects of cycle specification: rho=, variance= and period= options along with noest= parenthesized list gives you all the control (period specification is equivalent to frequency specification; period=2*Pi/frequency).  Anyhow, here are some steps that might help in difficult cycle identification.  All these steps try to reduce the flexibility of the trend component.

1.  If the series level appears relatively constant, use constant trend: level variance=0 noest;  No slope term.

2.  If the series seems to have a fairly constant linear trend, use the line as a trend:

     level variance=0 noest; slope variance=0 noest;

3.  If the series has more complicated trend, use a smoother version:

     level variance=0 noest; slope;

Start with just one cycle first.

UCM doc: SAS/ETS(R) 14.1 User's Guide

View solution in original post


All Replies
SAS Employee
Posts: 416

Re: Unobserved Components Model

Hello -

I suspect your data does not contain a valid ID variable - most likely your variable YEAR is character or at least not in date format.

See: http://support.sas.com/documentation/cdl/en/etsug/68148/HTML/default/viewer.htm#etsug_intervals_toc.... for more information.

Would you be able to share your data or a subset?

Thanks,

Udo

Contributor
Posts: 24

Re: Unobserved Components Model

Thank you i was able to sort the problem by using the input command.

I have a data set with 64 observations and the graph suggests a trend+cycle model. i start with the LLT model and utilize the following command

proc ucm data = book;

id year interval = year;

model level;

irregular;

level;

slope;

cycle;

cycle;

estimate;

run;

however this is a stationary cycle and i want to estimate stochastic cycles so i modify the command and use

cycle rho=1 noest=rho;

cycle rho=1 noest=rho;

however the estimates are not correct for example the cycle period is above 100. Also can I specify the frequency in the command???


Solution
‎09-25-2015 06:23 AM
SAS Employee
Posts: 49

Re: Unobserved Components Model

Identifying cycles can be tricky.  High frequency cycle can be masked by an irregular component and low frequency cycle can get masked by a flexible trend.  I am not sure why you are using two cycle statements.  Do you think there are multiple cycles?  UCM does permit you to control all aspects of cycle specification: rho=, variance= and period= options along with noest= parenthesized list gives you all the control (period specification is equivalent to frequency specification; period=2*Pi/frequency).  Anyhow, here are some steps that might help in difficult cycle identification.  All these steps try to reduce the flexibility of the trend component.

1.  If the series level appears relatively constant, use constant trend: level variance=0 noest;  No slope term.

2.  If the series seems to have a fairly constant linear trend, use the line as a trend:

     level variance=0 noest; slope variance=0 noest;

3.  If the series has more complicated trend, use a smoother version:

     level variance=0 noest; slope;

Start with just one cycle first.

UCM doc: SAS/ETS(R) 14.1 User's Guide

Contributor
Posts: 24

Re: Unobserved Components Model

Thank you for your reply.

I start with plotting the data. The plot shows the presence of cycles. Closer scrutiny seems to suggest a cycle of around 9-11 years and a smaller one of 5-6 years (this matches the theoretical background of my research problem).

However when I use the proc ucm statement my estimates are incorrect (cycle periods are in hundreds and thousands!)

I have tried all the steps you have suggested (1 cycle, level variance=0 noest, level variance=0 noest; slope variance=0 noest and level variance=0 noest; slope). However my cycle estimates are still very large in one case it is 2222.

Could you suggest what step I can take?????

(I tried to attach my data but the link did not work for me)

 

Thank you for your help.

SAS Employee
Posts: 49

Re: Unobserved Components Model

Please send me your data.  rajesh.selukar@sas.com

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 1043 views
  • 1 like
  • 3 in conversation