title: Calculate Period Changes in Unevenly Sampled Times Series in R (or Matlab)
body: <p>The heading says it all, I'm trying desperately to figure out a way calculate the period of a time series that is unevenly sampled. I tried creating an evenly sampled time series with NAs for the times where there is no data, but there are just too many NAs for any imputation method to do a reasonable job. The main problem being that the sample times are much further apart than the average period (VERY roughly 0.5), which is only obvious with period-folding applied. Because I'm looking for a small change in period, I can't round the sampling times.</p>
  
  <p><a href="https://i.stack.imgur.com/Ox2xg.jpg" rel="nofollow noreferrer">Time-folded period</a></p>
  
  <p>Here is a sample of the data:</p>
  
  <pre><code>HJD(time)  Mag    err
  2088.91535 18.868 0.078
  2090.87535 19.540 0.165
  2103.92958 18.704 0.040
  2104.94812 19.291 0.098
  2106.84596 18.910 0.066
  ...
  4864.56170 18.835 0.061
  </code></pre>
  
  <p>The data set has about 650 rows.</p>
  
  <p>I've spent almost a week googling my problem and nothing has helped yet so any ideas would be greatly appreciated! I have some experience with Matlab too, so if it's possible to do it with Matlab rather than R, I'd be happy with that too.</p>