*Dear Miss SAS Answers,*

*I am having a tough time developing SAS code to determine volatility ( i.e.: the moving standard deviation using GARCH approach). I need a conditional volatility measure of exchange rate from past 40 years. I have data from the past 50 years, and I would like to determine volatility using previous 10 years' real exchange rate. Could you please help me?*

*Sincerely,*

*Mercurial Mike*

Dear Mike,

I have to admit that you totally lost me after the first occurence of the word "volatility". Fortunately for both of us, I have some very smart statistical friends. :-) Dr. Bob Lucas sent the following to educate us both:

PROC AUTOREG in SAS/ETS can be used to estimate GARCH models. PROC EXPAND in SAS/ETS calculates many moving summary statistics including the option CMOVSTD, which stands for Centered MOVing Standard Deviation. The user can specify the width of the window over which the statistic is calculated.
From the SAS/ETS documentation: |

Moving Time Window Operators
Some operators compute statistics for a set of values within a moving time window; these are called The centered moving time window operators are CMOVAVE, CMOVCSS, CMOVGMEAN, CMOVMAX, CMOVMED, CMOVMIN, CMOVPROD, CMOVRANGE, CMOVRANK, CMOVSTD, CMOVSUM, CMOVTVALUE, CMOVUSS, and CMOVVAR. These operators compute statistics of the values for observations The backward moving time window operators are MOVAVE, MOVCSS, MOVGMEAN, MOVMAX, MOVMED, MOVMIN, MOVPROD, MOVRANGE, MOVRANK, MOVSTD, MOVSUM, MOVTVALUE, MOVUSS, and MOVVAR. These operators compute statistics of the values . All the moving time window operators accept an argument specifying the number of periods to include in the time window. For example, the following statement computes a five-period backward moving average of convert x=y / transformout=( movave 5 ); In this example, the resulting transformation is y The following statement computes a five-period centered moving average of convert x=y / transformout=( cmovave 5 ); In this example, the resulting transformation is y |

It sounds to me like SAS/ETS with PROC AUTOREG or PROC EXPAND might be just what you're looking for. (Remember, I'm an English major. However, Dr. Lucas is a statistical whiz, so following his advice on forecasting is probably a pretty good bet.)

I hope this helps solve your estimating/forecasting dilemna. If you are interested in SAS/ETS training, our * Forecasting Using SAS Software: A Programming Approach* course (taught by forecasting experts) is offered in both our traditional classroom setting and via Live Web.

Happy forecasting,

Miss SAS Answers

## 1 Comment

For those without ETS, there was a long thread about "rolling standard deviations" on SAS-L a while back (2008) ... you can start at ...

http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0804B&L=sas-l&P=32714

and keep clicking on the subject line to follow the thread. Lots of good ideas.