数据插补算法 [英] Algorithm for data interpolation

查看:104
本文介绍了数据插补算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想找到以下问题的简单解决方案:

就离散点而言,我有两个时间序列数据集.现在,在不涉及广泛的回归数学的情况下,我需要找出这两个数据系列的交点.近似近似就足够了.

相交点在时间序列的最大值和最小值之间,即它们在数据集的端点内相交.

围绕Oracle或C#/VB.NET的解决方案将是理想的.

谢谢,

[更新:稍加说明]
有两组数据点:

设置一个说法:

(0,1),(1,5),(5,11),(10,17),(12,21),(15,25),(20,32),(30,43),(40 ,41)


B集说:

(4,11),(11,15),(15,21),(20,37),(22,41),(25,55),(30,62),(40,73),(50 ,81)
(这些数字是任意的,因此,如果这些数字实际上没有相交或具有多个交叉点,请原谅)

在我的情况下,这些曲线是需求供应线,它们在一个点且只有一个点相交.我需要用一个简单的数字算法找出这个交点.

如果有帮助,我可以提供实际数字.

提前谢谢.
[/Update]

Hi,

I would like to find out a simple solution to the following problem:

I have two time series data sets, in terms of discrete points. Now without involving extensive regression mathematics, i need to find out the point of intersection of these two data series. A close approximation would be good enough.

The point of intersection is between the maxima and minima of the time series, i.e. they intersect within the extremities of the dataset.

A solution around Oracle or C#/VB.NET would be ideal.

Thanks,

[Update: a bit of elaboration]
There are two sets of data points:

Set A say:

(0,1),(1,5),(5,11),(10,17),(12,21),(15,25),(20,32),(30,43),(40,41)
and

Set B say:

(4,11),(11,15),(15,21),(20,37),(22,41),(25,55),(30,62),(40,73),(50,81)
(these numbers are just arbitrary, so please excuse if these do not actually intersect, or have more than one intersection points)

In my case, these curves are demand supply lines, which meet at one and only one point. This point of intersection is what i need to find out, with a simple numeric algorithm.

I can provide actual numbers if that helps.

Thanks in advance.
[/Update]

推荐答案

您好,请考虑每个点对(顶点)形成一条边.这样,就可以为时间序列1构造一个边列表,为时间序列2构造另一个边列表

例如,该序列类似于edge1(pt1,pt2)edge2(pt2,pt3).... so,因此在一个顶点上与前一条边重叠.

现在进行双循环检查

[这是一个伪代码]
对于edgelist1中的每个edge1
对于edgelist2中的每个edge2
检查edge1是否与edge2相交,然后断开并返回那些相交点
结束
结束

现在如何检查它是否相交.根据规则,如果两条边相交,则其创建的矩形(边界空间)也将相交.例如说edge1(10,10 20,20)edge2(10,20 30,10).如果绘制,则这些边缘相交.让我们证明一下. edge1的边界rect = rect(10,10 20,10 20,20 10,20),edge2的边界rect = rect(10,20 10,30 30,10 30,20).看到两个rect都有一个公共点10,20,所以它相交.

但这并非总是如此.不会存在一个矩形的公共点,而是该矩形的一个角会出现在另一个矩形空间中(您可以从角x是否位于其他矩形的x范围和角y之间找到该角)中找到该矩形.其他矩形的y范围).如果是这样,则两个边缘都相交.找到相交点并返回.

希望这能给您一个想法
Hi consider each point pair(vertices) form a edge. In that way construct a list of edges for time series 1 and another list for time series 2

for example the series goes like edge1(pt1,pt2) edge2(pt2,pt3) ....so on one vertex overlap with the previous edge.

Now in a double loop check

[this is a pseudo code]
for each edge1 in edgelist1
for each edge2 in edgelist2
check if edge1 intersect edge2 then break and return those intersection point
end
end

now how to check it intersect or not. By the rule if two edges intersect then the rectangle (bounding space) created by it also intersect. Say for example edge1 (10,10 20,20) edge2 (10,20 30,10). If plotted these edges intersect. Let us prove. Bound rect for edge1 = rect(10,10 20,10 20,20 10,20) and bound rect for edge2= rect(10,20 10,30 30,10 30,20). See both rect has a common point 10,20 so it intersects.

But this is not the case always. There won''t be a common point of the rects present instead one corner of the rect will present in the other rects space (that you can find out from if the corner x is between x range of other rect and corner y is between the y range of other rect). If so, then both edges are intersecting. Find the intersection point and return.

hope this give you an idea


您可以:
  • 假设每个时间序列的点都位于一条曲线上(并且这些曲线具有解析表示形式:例如一条直线).
  • 使用 ^ ]来查找曲线的参数.
  • 查找(分析或数字方式)两条曲线的交点.
You may:
  • Assume the points of each time series lie on a curve (and the curves have analytical representation: for instance a straight line).
  • Use the method of least squares[^] to find the parameters of the curves.
  • Find (either analytically or numerically) the intersection of the two curves.


这篇关于数据插补算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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