Turn on suggestions

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

Showing results for

- Home
- /
- Analytics
- /
- Forecasting
- /
- Re: Unobserved Components Model

Options

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

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 07-30-2015 03:42 AM
(2362 views)

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

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

5 REPLIES 5

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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???

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

⏰

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.** **

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.