Time Series Interpolation

后端 未结 1 1030
余生分开走
余生分开走 2021-01-21 10:30

I have two series of data (calibration and sample) and am trying to interpolate the calibration data from monthly to the frequency of the sample which randomly changes between m

相关标签:
1条回答
  • 2021-01-21 10:54

    If your data-set is already formatted as date-time you don't need to struggle with using zoo. Here, I simply used approx function and it gave me exactly what I wanted. You can get the data-set from the question to reproduce the code.

           ipc <- approx(calib$Date,calib$MW2, xout = sample$`DateMW-2`, 
           rule = 1, method = "linear", ties = mean)
    

    You can see that the data is being interpolated linearly between the given data points.

    Thanks for your insightful comments.

    0 讨论(0)
提交回复
热议问题