<?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: Using Cross Correlation to determine time delay between two signals in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441580#M3037</link>
    <description>&lt;P&gt;BTW, I forget to mention that if you use SAS Studio, the forecasting tasks provide an easy point-and-click interface that generates code for this type of analysis and much more.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I should put this sentence as my signature&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Mar 2018 15:15:01 GMT</pubDate>
    <dc:creator>mitrov</dc:creator>
    <dc:date>2018-03-02T15:15:01Z</dc:date>
    <item>
      <title>Using Cross Correlation to determine time delay between two signals</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441481#M3033</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I have is two signals in time (x=time in seconds, y=Force) and they are lagged (see&amp;nbsp;graph bellow). The lag is unknown to me and I have more than 5000 of this pair of curves. I need to align all this pairs or curves to enable other posterior analysis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="crosscorrelation.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18915i79D5BCDED8B20718/image-size/large?v=v2&amp;amp;px=999" role="button" title="crosscorrelation.PNG" alt="crosscorrelation.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To do that, I would normally use the cross correlation method to find the &lt;SPAN&gt;the point in time where the two signals are best aligned&amp;nbsp;&lt;/SPAN&gt;in seconds . After I have the this optimal set point, I can use this number to correct one of the time series and make them match.&lt;/P&gt;&lt;P&gt;The problem is that I never did this in sas and I was wondering if there is a procedure that I can use or I need to code this in sas base from scratch myself. I google quite a bit and I'm not sure if what I call a cross correlation could be done with proc timeseries, or proc&amp;nbsp;ARIMA in EG or even with some TS node in EM.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would take any recommendation regardless of it is the name of a procedure, a sas base program, or an em node.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 15:46:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441481#M3033</guid>
      <dc:creator>EBB</dc:creator>
      <dc:date>2018-03-02T15:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using Cross Correlation to determine time delay between two signals</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441575#M3034</link>
      <description>&lt;P&gt;You can call PROC TIMESERIES to compute cross correlation of two time series. See the following for a simple code example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc timeseries data=sashelp.pricedata out=_NULL_ outcrosscorr=crosscorr;&lt;BR /&gt; crosscorr _ALL_ / nlags=12;&lt;BR /&gt; id date interval=month;&lt;BR /&gt; var sale price;&lt;BR /&gt; by region line product;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;You can also check&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/etsug/66840/HTML/default/viewer.htm#etsug_timeseries_syntax05.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/etsug/66840/HTML/default/viewer.htm#etsug_timeseries_syntax05.htm&lt;/A&gt; for more&amp;nbsp;details on the PROC and related functionalities.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 14:50:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441575#M3034</guid>
      <dc:creator>Puwang</dc:creator>
      <dc:date>2018-03-02T14:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using Cross Correlation to determine time delay between two signals</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441576#M3035</link>
      <description>&lt;P&gt;You can use PROC TIMESERIES to compute crosscorrelations. You need to use the CROSSCORR and CROSSVAR statements. Here is simple example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
  call streaminit(123); 
  do i=1 to 103;
     x = rand("Uniform");
     y = lag3(x);
     if i &amp;gt;  3 then output;
  end;
  drop i;
run;

proc timeseries data = temp crossplot=all outcrosscorr=outcrosscorr;
   crosscorr lag n ccov ccf ccfstd;
   var x;
   crossvar y;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am not sure exactly what the purpose of your analysis is, but you may want to look also at the SIMILARITY procedure. It allows you to compute a distance matrix between series using time warping rather than cross-correlation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 14:52:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441576#M3035</guid>
      <dc:creator>mitrov</dc:creator>
      <dc:date>2018-03-02T14:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using Cross Correlation to determine time delay between two signals</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441578#M3036</link>
      <description>&lt;P&gt;Thanks for that! I also thought about DTW but it does not fit to what I need to do afterwards with the data. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 14:55:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441578#M3036</guid>
      <dc:creator>EBB</dc:creator>
      <dc:date>2018-03-02T14:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using Cross Correlation to determine time delay between two signals</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441580#M3037</link>
      <description>&lt;P&gt;BTW, I forget to mention that if you use SAS Studio, the forecasting tasks provide an easy point-and-click interface that generates code for this type of analysis and much more.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I should put this sentence as my signature&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 15:15:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441580#M3037</guid>
      <dc:creator>mitrov</dc:creator>
      <dc:date>2018-03-02T15:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using Cross Correlation to determine time delay between two signals</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441590#M3038</link>
      <description>&lt;P&gt;Links:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="SAS Studio" href="http://video.sas.com/detail/videos/performing-time-series-analyses/video/4414522299001/time-series-overview-using-sas-studio?autoStart=true" target="_blank"&gt;Time Series and Forecasting tasks&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="SAS Studio" href="http://go.documentation.sas.com/?docsetId=webeditorref&amp;amp;docsetTarget=titlepage.htm&amp;amp;docsetVersion=3.7&amp;amp;locale=en" target="_blank"&gt;SAS Studio&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="Time Series Data Preparation" href="http://video.sas.com/detail/videos/performing-time-series-analyses/video/4414522300001/time-series-data-preparation-using-sas-studio?autoStart=true" target="_self"&gt;Time Series Data Preparation&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="Time Series Exploration" href="http://video.sas.com/detail/videos/performing-time-series-analyses/video/4414522301001/time-series-exploration-using-sas-studio?autoStart=true" target="_blank"&gt;Time Series Exploration&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="Time Series Modeling and Forecasting" href="http://video.sas.com/detail/videos/performing-time-series-analyses/video/4414522302001/time-series-modeling-and-forecasting-using-sas-studio?autoStart=true" target="_blank"&gt;Time Series Modeling and Forecasting&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 15:33:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441590#M3038</guid>
      <dc:creator>mitrov</dc:creator>
      <dc:date>2018-03-02T15:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using Cross Correlation to determine time delay between two signals</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441592#M3039</link>
      <description>&lt;P&gt;Let's see how my signature looks now.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 16:21:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Using-Cross-Correlation-to-determine-time-delay-between-two/m-p/441592#M3039</guid>
      <dc:creator>mitrov</dc:creator>
      <dc:date>2018-03-02T16:21:10Z</dc:date>
    </item>
  </channel>
</rss>

