R — Method for Interpolation over 2d datset with missing values

吃可爱长大的小学妹 提交于 2019-12-12 17:21:39

问题


I am currently using the 'Akima' interp routine in order to do 2d linear interpolation. I'm currently trying to do linear interpolations as best as I can by excluding the bad datpoints and interpolated values that depend upon them. I don't want to do any spline fitting just linear interpolation.

I can think of two ways to do this using the existing akima package;

  1. by partitioning the 2d datasets into valid subsets that do not have missing data points, and then interpolating on each, and then merging the results.
  2. or by setting the missing value to a nonsense value, (-1.0 in my case), and then marking the results where any interpolated value NA. Unfortunately, the indices of the interpolation nodes do not appear to be returned, so I'll have to find these nodes myself in which case I should just write my own routine.

Each is a a bit of a pain and I'm sure there must be a better way or there must be a package to do one of the above as this I'm sure is a common problems that many have had.

Any recommendations for an alternative interpolation routine or method to use akima interp is greatly appreciated. Bob


回答1:


Have you looked at the Amelia package?



来源:https://stackoverflow.com/questions/8469024/r-method-for-interpolation-over-2d-datset-with-missing-values

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!