使用已知积分Python进行曲线拟合 [英] Curve Fitting with Known Integrals Python

查看:220
本文介绍了使用已知积分Python进行曲线拟合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些数据是箱内未知曲线的积分。为了您的利益,数据是海浪能量,垃圾箱是用于指示方向的,例如0-15度。如果可能的话,我想在数据上拟合一条曲线,以保留分档内的积分。我尝试用铅笔在记事本上绘制草图,似乎有可能。有谁知道用Python中的任何曲线拟合工具来做到这一点,例如在scipy插值子包中?

I have some data that are the integrals of an unknown curve within bins. For your interest, the data is ocean wave energy and the bins are for directions, e.g. 0-15 degrees. If possible, I would like to fit a curve on to the data that conserves the integrals within the bins. I've tried sketching it on a notepad with a pencil and it seems like it could be possible. Does anyone know of any curve-fitting tool in Python to do this, for example in the scipy interpolation sub-package?

预先感谢

编辑:

谢谢您的帮助。如果执行此操作,则看起来我将尝试本文第4节中推荐的方法: http://journals.ametsoc.org/doi/abs/10.1175/1520-0485%281996%29026%3C0136%3ATIOFFI%3E2。 0.CO%3B2 。从理论上讲,它基本上是使用矩阵从每个谱带之间的已知积分中得出一些伪数据。绘制后,此数据将生成一个插值线图,该图保留了积分。

Thanks for the help. If I do it, it looks like I will try the method that is recommended in section 4 of this paper: http://journals.ametsoc.org/doi/abs/10.1175/1520-0485%281996%29026%3C0136%3ATIOFFI%3E2.0.CO%3B2. In theory, it basically uses matrices to make some 'fake' data from the known integrals between each band. When plotted, this data then produces an interpolated line graph that preserves the integrals.

推荐答案

1 / fit2histogram

您的问题是关于拟合直方图。我刚看过一些文档,其中包含用于多变量模式分析的Python软件包,PyMVPA,并提出了一些用于直方图拟合的功能。此处是一个示例: PyMVPA

Your question is about fitting an histogram. I just came through documentation for some Python package for Multi-Variate Pattern Analysis, PyMVPA, and some function for histogram fitting is proposed. An example is here: PyMVPA.

但是,我想可用的发行版仅限于著名的发行版。

However, I guess that set of available distributions is limited to famous distributions.

2 /积分计算

如前所述,下一个解决方案是整数值,并使模型适合所生成的数据集。您要么知道导数的显式表达式,要么使用计算导数:有限差分,解析方法。

As already mentionned, next solution is to approximate integral value, and to fit a model to the resulting set of data. Either you know explicit expression for the derivative, or you use computational derivation: finite difference, analytical method.

这篇关于使用已知积分Python进行曲线拟合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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