<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: smooth abnormalities in a time-series in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20710#M612</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Udo.. I like this approach and seems to be the right one.. but where I get stuck is where you mentioned&amp;nbsp; "&lt;STRONG&gt;of course you will need to find out what flags "bad fit" in your context;" &lt;/STRONG&gt;as this is an importnat piece of the assignment.&amp;nbsp; I other words, every month is a relatively small incremental increase, which could be normal, but 4 or 5 months together could add to a abnormal spike, which is what I want to target. But can't becasue of these small monthly increases.&amp;nbsp; Know what I mean?&amp;nbsp; I'd appreciate if you have any suggestions. Of coarse you also menationed that I can set the "bad&amp;nbsp; fit" to missing and replace with timeseries, but again I don't know how to assign the bad fit definition.&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks Udo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Mar 2012 03:10:44 GMT</pubDate>
    <dc:creator>podarum</dc:creator>
    <dc:date>2012-03-05T03:10:44Z</dc:date>
    <item>
      <title>smooth abnormalities in a time-series</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20707#M609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp; I have many series of data (timed-series), so I'm looking for a automated procedure for this fix.&amp;nbsp; But my challenge is that I'm following a price (6-month rolling average) over a period of time that has different start dates for different series (eg. stores and products)...&amp;nbsp; and the main challenge is that I have these spikes in prices, that could happen at any point in time and for an undisclosed time-frame.&amp;nbsp; See Sample charts below.&amp;nbsp; I need to somehow smooth out these spikes, but only where they are real explosive.&amp;nbsp; So does anyone know in SAS how I can smooth out the data if for example the data has a 200% growth over a 1 year period.. but since it's gradually increasing since this is monthly data, I have to be careful I don't smooth out good data.&amp;nbsp; What I mean by that is that if the first month it increase by 20% (reasonable) and second month again another 20% (reasonable), and so on,, in one year it is 240%,.. how can I capture and smooth that.&amp;nbsp;&amp;nbsp; Or I'd love to hear any other suggestions on how to deal wiht this issue.&amp;nbsp; I do have SAS/ETS.&lt;/P&gt;&lt;P&gt;Thanks so much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example I don't really want to smooth out anything in SAMPLE -A but do want the spike in SAMPLE -B&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="1510" alt="SAMPLE-A.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/1510_SAMPLE-A.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="1511" alt="SAMPLE-B.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/1511_SAMPLE-B.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 18:57:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20707#M609</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-03-02T18:57:32Z</dc:date>
    </item>
    <item>
      <title>smooth abnormalities in a time-series</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20708#M610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello -&lt;/P&gt;&lt;P&gt;One approach which you might want to consider is to winsorize your data using ESM for example. &lt;/P&gt;&lt;P&gt;Here is an example:&lt;/P&gt;&lt;P&gt;*create some test data by adding some extreme spike;&lt;/P&gt;&lt;P&gt;data air;&lt;/P&gt;&lt;P&gt;set sashelp.air;&lt;/P&gt;&lt;P&gt;if date="01JAN1954"d then air=air+200;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;*plot the modified series;&lt;/P&gt;&lt;P&gt;proc sgplot data=air;&lt;/P&gt;&lt;P&gt;series x=date y=air;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;*run ESM with WINTERS method - since the data is seasonal and trending upwards, in your case you might have to use a different technique, such as SIMPLE;&lt;/P&gt;&lt;P&gt;proc esm data=air out=_null_ outfor=want lead=0;&lt;/P&gt;&lt;P&gt;id date interval=month;&lt;/P&gt;&lt;P&gt;forecast air / method=winters;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;*replace values which have a bad fit with the ESM forecast - of course you will need to find out what flags "bad fit" in your context;&lt;/P&gt;&lt;P&gt;data want; &lt;/P&gt;&lt;P&gt;set want(rename=actual=air drop=_name_ upper lower);&lt;/P&gt;&lt;P&gt; if abs(error) ge 1*std and air ne 0 then air=predict;&lt;/P&gt;&lt;P&gt;drop error std predict;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;*plot the result;&lt;/P&gt;&lt;P&gt;proc sgplot data=want;&lt;/P&gt;&lt;P&gt;series x=date y=air;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using the prediction of ESM you could also use other values such as the series median, or the previous value, etc.&lt;/P&gt;&lt;P&gt;In this case you could set the values with bad fit to missing and use TIMESERIES to replace the missing values in a 3rd step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this makes sense,&lt;/P&gt;&lt;P&gt;Udo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 21:00:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20708#M610</guid>
      <dc:creator>udo_sas</dc:creator>
      <dc:date>2012-03-02T21:00:04Z</dc:date>
    </item>
    <item>
      <title>smooth abnormalities in a time-series</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20709#M611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; As usual Thanks Udo.. I will try it and post..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Mar 2012 04:55:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20709#M611</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-03-03T04:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: smooth abnormalities in a time-series</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20710#M612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Udo.. I like this approach and seems to be the right one.. but where I get stuck is where you mentioned&amp;nbsp; "&lt;STRONG&gt;of course you will need to find out what flags "bad fit" in your context;" &lt;/STRONG&gt;as this is an importnat piece of the assignment.&amp;nbsp; I other words, every month is a relatively small incremental increase, which could be normal, but 4 or 5 months together could add to a abnormal spike, which is what I want to target. But can't becasue of these small monthly increases.&amp;nbsp; Know what I mean?&amp;nbsp; I'd appreciate if you have any suggestions. Of coarse you also menationed that I can set the "bad&amp;nbsp; fit" to missing and replace with timeseries, but again I don't know how to assign the bad fit definition.&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks Udo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Mar 2012 03:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20710#M612</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-03-05T03:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: smooth abnormalities in a time-series</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20711#M613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello -&lt;/P&gt;&lt;P&gt;Some additional thoughts on my response (for what it's worth): &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;the first challenge I see is to identify an appropriate forecasting model, to avoid filtering out a "signal". If your data is seasonal then spikes can represent a pattern of course, if your data is trending upwards (or downwards) - as it seems to be the case - you will need to use a trend model. Maybe you will need a model which allows for both trend and seasonality. ESM provides you with access to all of these models. If you would have access to HPF as well, then your could use PROC HPF to do a best pick approach. Note the ESM models consider a local trend instead of a global trend - for a nice overview see: &lt;A href="http://www.sas.com/reg/wp/corp/3478"&gt;http://www.sas.com/reg/wp/corp/3478&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;The signal to noise ratio is also important to figure out the right value for how many STD to consider. If your data is fairly noisy, then higher values of STD will make more sense, as otherwise you will be filtering data which are not really extreme values. The examples you provided seem to suggest that your data is not very noisy.&lt;/LI&gt;&lt;LI&gt;It might also be worthwhile to consider to difference your data - so instead of the original series you will try to analyze the series of first differences. In this case you should be able to detect "huge" changes in the data even better. &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;data air;&lt;/P&gt;&lt;P&gt;set sashelp.air;&lt;/P&gt;&lt;P&gt;if date="01JAN1954"d then air=air+200;&lt;/P&gt;&lt;P&gt;air2=dif(air);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sgplot data=air;&lt;/P&gt;&lt;P&gt;series x=date y=air2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Udo&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 13:43:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20711#M613</guid>
      <dc:creator>udo_sas</dc:creator>
      <dc:date>2012-03-06T13:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: smooth abnormalities in a time-series</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20712#M614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Udo... i started playing with Lags and differences and am seeing couple of roadblocks in that.. for example if the data starts high and then drops 100% to a normal level, or if the data starts normal and then has a long period increase like more than 7 months, and then back to normla, I still get a spike... too many tricks to cover..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 13:51:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20712#M614</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-03-06T13:51:53Z</dc:date>
    </item>
    <item>
      <title>smooth abnormalities in a time-series</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20713#M615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share some example data with me? &lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Udo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 18:09:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20713#M615</guid>
      <dc:creator>udo_sas</dc:creator>
      <dc:date>2012-03-06T18:09:17Z</dc:date>
    </item>
    <item>
      <title>smooth abnormalities in a time-series</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20714#M616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data is monthly based,&amp;nbsp; on a 6-month rolling average... &lt;/P&gt;&lt;P&gt;All 4 samples have spikes in different ways that I'd like to get rid of..&amp;nbsp; Thanks Udo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Date&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="text-decoration: underline;"&gt;Price&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2003.03&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 571&lt;/P&gt;&lt;P&gt;2003.04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 483&lt;/P&gt;&lt;P&gt;2003.05&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 571&lt;/P&gt;&lt;P&gt;2003.06&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 428&lt;/P&gt;&lt;P&gt;2003.07&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 428&lt;/P&gt;&lt;P&gt;2003.08&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 395&lt;/P&gt;&lt;P&gt;2003.09&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 334&lt;/P&gt;&lt;P&gt;2003.10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 242&lt;/P&gt;&lt;P&gt;2003.11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 243&lt;/P&gt;&lt;P&gt;2003.12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 251&lt;/P&gt;&lt;P&gt;2004.01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 267&lt;/P&gt;&lt;P&gt;2004.02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 244&lt;/P&gt;&lt;P&gt;... it could gradually go up to Price= 600 which is fine...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And another Sample is&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Date&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="text-decoration: underline;"&gt;Price&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2002.11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 267&lt;/P&gt;&lt;P&gt;2002.12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 278&lt;/P&gt;&lt;P&gt;2003.01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 330&lt;/P&gt;&lt;P&gt;2003.02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 390&lt;/P&gt;&lt;P&gt;2003.03&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 571&lt;/P&gt;&lt;P&gt;2003.04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 483&lt;/P&gt;&lt;P&gt;2003.05&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 571&lt;/P&gt;&lt;P&gt;2003.06&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 428&lt;/P&gt;&lt;P&gt;2003.07&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 428&lt;/P&gt;&lt;P&gt;2003.08&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 395&lt;/P&gt;&lt;P&gt;2003.09&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 334&lt;/P&gt;&lt;P&gt;2003.10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 242&lt;/P&gt;&lt;P&gt;2003.11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 243&lt;/P&gt;&lt;P&gt;2003.12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 251&lt;/P&gt;&lt;P&gt;2004.01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 267&lt;/P&gt;&lt;P&gt;2004.02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 244&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAMPLE 3&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Date&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="text-decoration: underline;"&gt;Price&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2002.11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 267&lt;/P&gt;&lt;P&gt;2002.12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 278&lt;/P&gt;&lt;P&gt;2003.01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 330&lt;/P&gt;&lt;P&gt;2003.02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 390&lt;/P&gt;&lt;P&gt;2003.03&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 571&lt;/P&gt;&lt;P&gt;2003.04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 483&lt;/P&gt;&lt;P&gt;2003.05&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 571&lt;/P&gt;&lt;P&gt;2003.06&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 428&lt;/P&gt;&lt;P&gt;2003.07&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 428&lt;/P&gt;&lt;P&gt;2003.08&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 395&lt;/P&gt;&lt;P&gt;2003.09&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 334&lt;/P&gt;&lt;P&gt;2003.10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 242&lt;/P&gt;&lt;P&gt;2003.11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 243&lt;/P&gt;&lt;P&gt;2003.12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 600&lt;/P&gt;&lt;P&gt;2004.01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 644&lt;/P&gt;&lt;P&gt;2004.02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 674&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And Last sample:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Date&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="text-decoration: underline;"&gt;Price&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2002.11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 675&lt;/P&gt;&lt;P&gt;2002.12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 680&lt;/P&gt;&lt;P&gt;2003.01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 688&lt;/P&gt;&lt;P&gt;2003.02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 290&lt;/P&gt;&lt;P&gt;2003.03&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 300&lt;/P&gt;&lt;P&gt;2003.04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 323&lt;/P&gt;&lt;P&gt;2003.05&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 364&lt;/P&gt;&lt;P&gt;2003.06&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 375&lt;/P&gt;&lt;P&gt;2003.07&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 380&lt;/P&gt;&lt;P&gt;2003.08&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 395&lt;/P&gt;&lt;P&gt;2003.09&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 334&lt;/P&gt;&lt;P&gt;2003.10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 242&lt;/P&gt;&lt;P&gt;2003.11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 243&lt;/P&gt;&lt;P&gt;2003.12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 251&lt;/P&gt;&lt;P&gt;2004.01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 267&lt;/P&gt;&lt;P&gt;2004.02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 244&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 18:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20714#M616</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-03-06T18:15:34Z</dc:date>
    </item>
    <item>
      <title>smooth abnormalities in a time-series</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20715#M617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; To make things interesting, I also need to deal with hills... so sharp dips in the data .. exactly the same pattern, but inverted as above...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 18:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20715#M617</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-03-06T18:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: smooth abnormalities in a time-series</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20716#M618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A quick intervention to mention the possible usefulness of proc convert (part of SAS ETS). If you have a means to identify the time series features that you want to smooth out then proc convert offers many interpolation methods to do the replacements. An example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Use variable keep to censor the unwanted prices */&lt;/P&gt;&lt;P&gt;data test(drop=datxt);&lt;BR /&gt;input datxt $ price keep;&lt;BR /&gt;dat = input(compress(datxt,"."),yymmn6.);&lt;BR /&gt;format dat yymmP7.;&lt;BR /&gt;if keep then censoredPrice = price;&lt;BR /&gt;datalines;&lt;BR /&gt;2002.11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 267 1&lt;BR /&gt;2002.12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 278 1&lt;BR /&gt;2003.01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 330 1&lt;BR /&gt;2003.02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 390 1&lt;BR /&gt;2003.03&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 571 0&lt;BR /&gt;2003.04&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 483 0&lt;BR /&gt;2003.05&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 571 0&lt;BR /&gt;2003.06&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 428 1&lt;BR /&gt;2003.07&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 428 1&lt;BR /&gt;2003.08&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 395 1&lt;BR /&gt;2003.09&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 334 1&lt;BR /&gt;2003.10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 242 1&lt;BR /&gt;2003.11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 243 1&lt;BR /&gt;2003.12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 600 1&lt;BR /&gt;2004.01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 644 1&lt;BR /&gt;2004.02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 674 1&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Replace the unwanted prices */&lt;/P&gt;&lt;P&gt;proc expand data=test out=smoothTest from=month to=month;&lt;BR /&gt;id dat;&lt;BR /&gt;convert censoredPrice = smoothedPrice;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="smoothedPrice.png" class="jive-image-thumbnail jive-image" onclick="" src="https://communities.sas.com/legacyfs/online/1515_smoothedPrice.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG added a graph.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 19:07:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20716#M618</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-03-06T19:07:08Z</dc:date>
    </item>
    <item>
      <title>smooth abnormalities in a time-series</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20717#M619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Great info .. thanks PGStats&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 19:08:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20717#M619</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-03-06T19:08:49Z</dc:date>
    </item>
    <item>
      <title>smooth abnormalities in a time-series</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20718#M620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello -&lt;/P&gt;&lt;P&gt;Many thanks for sharing your data examples. Needless to state that this is a challenging exercise, also due to the limited amount of history and the different types of "spikes".&lt;/P&gt;&lt;P&gt;We are currently working on a new procedure which should be useful for tackling these kind of challenges, which is not released yet. Basically it will provide access to "time series segmentation" methods, which will allow you to separate a series into a major and minor series. &lt;/P&gt;&lt;P&gt;As an illustration:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="segment.JPG" class="jive-image-thumbnail jive-image" onclick="" src="https://communities.sas.com/legacyfs/online/1522_segment.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;Unfortunately this won't help you today, as this procedure has not made its way to the production release, yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought maybe some other smoothing techniques might be useful. So I ran PROC LOESS on your data - again with mixed results, but it might give you some idea on how to proceed.&lt;/P&gt;&lt;P&gt;I'm not exactly an expert in using this procedure, but here it goes (I combined all your examples in one data set and used SAMPLE as a series indicator):&lt;/P&gt;&lt;P&gt;proc loess data=test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; model price=dat /select=AICC;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by sample;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;For the same sample as above LOESS creates the following graph:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="loess.JPG" class="jive-image-thumbnail jive-image" onclick="" src="https://communities.sas.com/legacyfs/online/1523_loess.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;IMG alt="residual.JPG" class="jive-image-thumbnail jive-image" onclick="" src="https://communities.sas.com/legacyfs/online/1524_residual.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;so you could filter out point which have a high residual.&lt;/P&gt;&lt;P&gt;Unfortunately this approach does not work well if the spikes are at the beginning or end of the series.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if this is really helpful - but I thought I share it anyway.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Udo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2012 19:54:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20718#M620</guid>
      <dc:creator>udo_sas</dc:creator>
      <dc:date>2012-03-07T19:54:13Z</dc:date>
    </item>
    <item>
      <title>smooth abnormalities in a time-series</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20719#M621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Udo,&amp;nbsp; very good to know.. For now I used a lag on Price and a lag o the lag and so on, for 4 months.. then set it to if the price drop between lags is a certain threshold OR climbs by a certain threshold, then indicate it... then use proc expand to create a moving average to smooth it out..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2012 20:16:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/smooth-abnormalities-in-a-time-series/m-p/20719#M621</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-03-07T20:16:11Z</dc:date>
    </item>
  </channel>
</rss>

