title: Calculate phase lag index between two time series
body: <p>I want to calculate phase lag index as defined in this paper using Matlab:
  <a href="http://kurage.nimh.nih.gov/tomh/PLI.pdf" rel="nofollow">http://kurage.nimh.nih.gov/tomh/PLI.pdf</a></p>
  
  <p>I have two equal-length time-series a and b. I am not sure how to do so. What I have done so far is:</p>
  
  <p>PLI = abs(mean(sign(phaseLag(a, b))));</p>
  
  <p>I have two questions:</p>
  
  <ol>
  <li>Did I understand the formula of PLI correctly? (I am doubtful.)</li>
  <li>If so, how to calculate phase lag?</li>
  </ol>