曲线拟合3D数据集

发布于 2024-07-14 17:15:26 字数 598 浏览 6 评论 0原文

2D 数据的曲线拟合问题是众所周知的(LOWESS 等),但给定一组 3D 数据点,如何将 3D 曲线(例如平滑/回归样条)拟合到该数据?

更多:我试图找到一条曲线,拟合由没有已知关系的向量 X、Y、Z 提供的数据。 本质上,我有一个 3D 点云,并且需要找到 3D 趋势线。

更多:对于含糊之处,我深表歉意。 我尝试了几种方法(我还没有尝试修改线性拟合),随机神经网络似乎效果最好。 即,我从点云中随机选取一个点,找到它的邻居的质心(在任意球体内),进行迭代。 连接质心以形成平滑样条线被证明是困难的,但获得的质心是可以通过的。

为了澄清问题,数据不是时间序列,我正在寻找一个最能描述点云的平滑样条线,即,如果我要将这个 3D 样条线投影到由任何 2 个变量形成的平面上,则投影样条线(到 2D 上)将是投影点云(到 2D 上)的平滑拟合。

IMG:我添加了一张图片。 红点代表通过上述方法获得的质心。

3D点云和本地质心http://img510.imageshack.us/img510/2495/40670529.jpg

The curve-fitting problem for 2D data is well known (LOWESS, etc.) but given a set of 3D data points, how do I fit a 3D curve (eg. a smoothing/regression spline) to this data?

MORE: I'm trying to find a curve, fitting the data provided by vectors X,Y,Z which have no known relation. Essentially, I have a 3D point cloud, and need to find a 3D trendline.

MORE: I apologize for the ambiguity. I tried several approaches (I still haven't tried modifying the linear fit) and a random NN seems to work out best. I.e., I randomly pick a point from the point cloud, find the centroid of it's neighbors (within an arbitrary sphere), iterate. Connecting the centroids to form a smooth spline is proving to be difficult but the centroids obtained is passable.

To clarify the problem, the data is not a time series and I'm looking for a smooth spline which best describes the point cloud I.e., if I were to project this 3D spline on a plane formed by any 2 variables, the projected spline (onto 2D) will be a smooth fit of the projected point cloud (onto 2D).

IMG: I've included an image. The red points represent the centroid obtained from the aforementioned method.

3D Point Cloud and Local Centroids http://img510.imageshack.us/img510/2495/40670529.jpg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

沙沙粒小 2024-07-21 17:15:26

相关问题在这里:

简单多维曲线拟合

一般来说,您可以查看这样的问题从统计学习的角度来看。 换句话说,您有一组以某种方式参数化的基函数(例如样条曲线),然后使用最小二乘法或某些其他回归技术来查找最佳系数。 我碰巧喜欢统计学习的要素

A related questions is here:

Simple multidimensional curve fitting

In general, you could view a problem like this from a statistical learning point of view. In other words, you have a set of basis functions (e.g., splines) parametrized in a certain way, and then you use least squares or some other regression technique to find optimal coefficients. I happen to like Elements of Statistical Learning

只为守护你 2024-07-21 17:15:26

您可以尝试添加(即单索引模型),如 GAM
http://www-stat.stanford.edu/software/gam/index.html html

这是一种贪婪的方法,非常可扩展,在多个 R 包中得到了很好的实现

You could try additive (i.e single index models), as GAM
http://www-stat.stanford.edu/software/gam/index.html

it's a greedy approach, very scalable, well implemented in several R packages

甜警司 2024-07-21 17:15:26

这取决于你的意思。 如果你有一组点 f(x,y) -> z 并且你想找到一个能够满足所有这些要求的函数,你只需做一个样条曲线即可。

如果您有一个已知函数并且想要调整参数以最小化 RMS 误差,只需考虑 x,ya 复合对象 p(例如,就好像它是复数或 2 向量)并使用 2d 情况的模拟关于 f(p) -> z。

如果您可以更具体地说明您想要完成的任务,我可以更具体地提出建议。

-- MarkusQ

因此,鉴于编辑后的问题陈述,我建议如下:

  • 如果它是一个时间序列(通过使用术语“趋势线”来暗示),我会将其视为三个参数函数 (x(t) , y(t), z(t)) 并对它们中的每一个进行 2d 拟合。
  • 或者(但仍然假设有一个有序序列),您可能需要找到一个线性拟合(一条穿过云中心的线),然后根据点的垂直投影添加某种(可能是极坐标)函数线。
  • 如果它不是时间序列(由短语“未知关系”和“点云”暗示),您必须定义要适合它们的“曲线”。 你想要一条线吗? 表面/流形? 您希望它是一个或两个变量的函数,还是独立于它们(例如,凸包)。 它必须是平滑的、有限的程度,还是……?

确实,这个问题仍然过于开放式。

It depends on what you mean by that. If you have a set of points f(x,y) -> z and you want to find a function that hits them all you could just do a spline.

If you have a known function and you want to adjust the parameters to minimize the RMS error, just consider x,y a composite object p (e.g., as if it were a complex or a 2-vector) and use an analog of the 2d case on f(p) -> z.

If you can be more specific about what you're trying to accomplish, I can be more specific with suggestions.

-- MarkusQ

So given the edited problem statement, I'd suggest the following:

  • If it's a time series (implied by your use of the term "trendline") I'd look at treating it as three parametric functions (x(t), y(t), z(t)) and doing 2d fitting on each of them.
  • Alternatively (but still assuming an ordered series), you may want to find a linear fit (a line through the heart of the cloud) and then add to that some sort of (probably polar) function based on the perpendicular projection from the points to the line.
  • If it isn't a time series (implied by the phrases "no known relation" and "point cloud") you have to define what "curve" you want to fit to them. Do you want a line? A surface / manifold? Do you want it to be a function of one or two of the variables, or independent of them (say, the convex hull). Does it have to be smooth, limited in degree, or...?

Really, the question is still too open ended.

黯淡〆 2024-07-21 17:15:26

我会尝试使用空间填充曲线启发式。 例如,按空间填充曲线访问点的顺序对点进行排序。 解决您的问题的一种方法是通过按该顺序获取的点的样条曲线。 要获得更短、更平滑的曲线(但从点到曲线的 RMS 距离更大),您可以强制样条线仅经过每个第 k 个点。 如果在选择每个第 k 个点后,您可以寻找通过它们的更短的哈密顿路径(类似于旅行商问题,但针对的是开放路径),则可以改进曲线。 您还可以调整样条线结来减小 RMS 距离。 在计算 RMS 距离时,我将使用空间填充曲线顺序来指示样条线的哪一部分可能最接近给定点。

I would try using the Spacefilling Curve Heuristic. For example, sort the points by the order they are visited by a spacefilling curve. One solution to your problem would be a spline curve through the points taken in that order. To get a shorter and smoother curve (but greater RMS distance from the points to the curve), you could force the spline to go through only every kth point. You could improve the curve if, after choosing every kth point, you looked for a shorter Hamiltonian path through them (like the Traveling Salesman Problem, but for open paths). You could also adjust the spline knots to decrease the RMS distance. When calculating the RMS distance, I would use the spacefilling curve order to indicate which part of the spline is likely to be closest to a given point.

生生不灭 2024-07-21 17:15:26

Charles Fefferman(是的,菲尔兹奖得主)和 Boaz Klartag 有一个非常的精彩作品:

您可以在 Klartag 的出版物页面上找到这两个文件的 pdf 文件

There is a new very nice work by Charles Fefferman (yes - the Fields medalist) and Boaz Klartag:

You can find Both of them as pdf files on Klartag's publications page

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文