问题描述
我附上了图片:
I attached image:
因此,在此图像中有一个功能图,该图在给定点上定义.例如在点x = 1..N.
So in this image there is a diagram of the function, which is defined on the given points.For example on points x=1..N.
另一幅绘制为半透明曲线的图,那就是我想从原始图中得到的,即我想对原始函数进行近似处理,以使其变得平滑.
Another diagram, which was drawn as a semitransparent curve,That is what I want to get from the original diagram,i.e. I want to approximate the original function so that it becomes smooth.
有没有这样做的方法?
我听说过最小二乘法,该方法可用于通过直线或抛物线函数近似函数.但是我不需要通过抛物线函数来近似.我可能需要通过三角函数对其进行近似.那么有什么方法可以做到这一点吗?一个想法是,如果我们可以将其推论为三角函数,是否可以使用最小二乘法?
I heard about least squares method, which can be used to approximate a function by straight line or by parabolic function. But I do not need to approximate by parabolic function.I probably need to approximate it by trigonometric function.So are there any methods for doing that?And one idea, is it possible to use the Least squares method for this problem, if we can deduce it for trigonometric functions?
还有一个问题!如果我使用离散傅立叶变换并将函数视为波的总和,那么噪声可能具有特殊的特征,我们可以通过该特征对其进行定义,然后可以将相应的频率设置为零,然后执行傅立叶逆变换.因此,如果您认为有可能,那么您可以提出什么建议来识别噪声的频率?
One more question!If I use the discrete Fourier transform and think about the function as a sum of waves, so may be noise has special features by which we can define it and then we can set to zero the corresponding frequency and then perform inverse Fourier transform.So if you think that it is possible, then what can you suggest in order to identify the frequency of noise?
推荐答案
不幸的是,此处介绍的许多解决方案都不能解决问题,并且/或者是完全错误的.有很多方法,它们是专门为解决您必须了解的条件和要求而设计的!
Unfortunately many solutions here presented don't solve the problem and/or they are plain wrong.There are many approaches and they are specifically built to solve conditions and requirements you must be aware of !
a)近似理论:如果您有一个非常清晰的定义函数而没有错误(由定义或数据给出),并且您想尽可能精确地跟踪它,则您正在使用Chebyshev或Legendre多项式的多项式或有理逼近,这意味着您通过多项式或(如果是周期性的话)傅里叶级数来逼近函数.
a) Approximation theory: If you have a very sharp defined function without errors (given by either definition or data) and you want to trace it exactly as possible, you are usingpolynominal or rational approximation by Chebyshev or Legendre polynoms, meaning that youapproach the function by a polynom or, if periodical, by Fourier series.
b)插值:如果您有一个给出一些点(但不是整个曲线!)的函数,并且需要一个函数来获得这些点,则可以使用几种方法:
b) Interpolation: If you have a function where some points (but not the whole curve!) are given and you need a function to get through this points, you can use several methods:
牛顿-格雷戈里(Newton-Gregory),具有不同差异的牛顿,拉格朗日(Lagrange),埃尔米特(Hermite),样条线
Newton-Gregory, Newton with divided differences, Lagrange, Hermite, Spline
c)曲线拟合:您有一个具有给定点的函数,并且想要使用给定(!)函数绘制一条曲线,该函数尽可能接近该曲线.有线性以及针对这种情况的非线性算法.
c) Curve fitting: You have a function with given points and you want to draw a curve with a given (!) function which approximates the curve as closely as possible. There are linearand nonlinear algorithms for this case.
您的图形涉及:
- 这远不像数学函数.
- 它不是由数据或函数明确定义的
- 您需要拟合曲线,而不是某些点.
您想要和需要的是
d)平滑:给定带有噪声或元素快速变化的曲线或数据点,您只想查看随时间的缓慢变化.
d) Smoothing: Given a curve or datapoints with noise or rapidly changing elements, you only want to see the slow changes over time.
您可以按照雅各布的建议用LOESS来做到这一点(但我发现这种说法过于矫kill,尤其是因为选择合理的跨度需要一些经验).对于您的问题,我只是建议吉姆·C(Jim C)建议的运行平均值.
You can do that with LOESS as Jacob suggested (but I find that overkill, especially becausechoosing a reasonable span needs some experience). For your problem, I simply recommendthe running average as suggested by Jim C.
http://en.wikipedia.org/wiki/Running_average
对不起,cdonner和Orendorff,您的建议很明确,但是完全错误,因为您使用正确的工具来解决错误的解决方案.
Sorry, cdonner and Orendorff, your proposals are well-minded, but completely wrong because you are using the right tools for the wrong solution.
这些家伙使用第六个多项式来拟合气候数据并完全自欺欺人.
These guys used a sixth polynominal to fit climate data and embarassed themselves completely.
http://scienceblogs.com/deltoid/2009/01/the_australians_war_on_science_32.php
这篇关于近似方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!