R -- 对具有缺失值的二维数据集进行插值的方法 [英] R -- Method for Interpolation over 2d datset with missing values

查看:19
本文介绍了R -- 对具有缺失值的二维数据集进行插值的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用Akima"插值例程来进行二维线性插值.我目前正在尝试通过排除依赖于它们的坏数据点和插值来尽可能地进行线性插值.我不想做任何样条拟合只是线性插值.

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.

使用现有的 akima 包,我可以想到两种方法;

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

  1. 通过将二维数据集划分为没有缺失数据点的有效子集,然后对每个子集进行插值,然后合并结果.
  2. 或者通过将缺失值设置为无意义值(在我的情况下为 -1.0),然后将结果标记为任何内插值 NA.不幸的是,插值节点的索​​引似乎没有返回,所以我必须自己找到这些节点,在这种情况下,我应该编写自己的例程.

每个都有点痛苦,我相信一定有更好的方法,或者必须有一个包来执行上述操作之一,因为我确定这是许多人遇到的常见问题.

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.

对于使用 akima interp 的替代插值例程或方法的任何建议,我们将不胜感激.鲍勃

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

推荐答案

你看过 Amelia 包吗?

这篇关于R -- 对具有缺失值的二维数据集进行插值的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆