数学中的插值

发布于 2024-12-09 05:55:53 字数 634 浏览 1 评论 0原文

请考虑以下分布:

rs={{400, 0.00929}, {410, 0.0348}, {420, 0.0966}, {430, 0.2}, {440, 0.328}, {450, 0.455}, 
    {460, 0.567}, {470, 0.676}, {480, 0.793}, {490, 0.904}, {500, 0.982}, {510, 0.997}, 
    {520,0.935}, {530, 0.811}, {540, 0.65}, {550, 0.481}, {560, 0.329}, {570,0.208}, 
    {580, 0.121}, {590, 0.0655}, {600, 0.0332}, {610, 0.0159}, {620, 0.00737}, 
    {630, 0.00334}, {640, 0.0015}, {650,0.000677}, {660, 0.000313}, {670, 0.000148}, 
    {680, 0.0000715}, {690,0.0000353}, {700, 0.0000178}}

在此处输入图像描述

我如何插值此分布以获得图像上任何位置的点的值X 轴?

Please consider the following distribution :

rs={{400, 0.00929}, {410, 0.0348}, {420, 0.0966}, {430, 0.2}, {440, 0.328}, {450, 0.455}, 
    {460, 0.567}, {470, 0.676}, {480, 0.793}, {490, 0.904}, {500, 0.982}, {510, 0.997}, 
    {520,0.935}, {530, 0.811}, {540, 0.65}, {550, 0.481}, {560, 0.329}, {570,0.208}, 
    {580, 0.121}, {590, 0.0655}, {600, 0.0332}, {610, 0.0159}, {620, 0.00737}, 
    {630, 0.00334}, {640, 0.0015}, {650,0.000677}, {660, 0.000313}, {670, 0.000148}, 
    {680, 0.0000715}, {690,0.0000353}, {700, 0.0000178}}

enter image description here

How could I interpolate this distribution to obtain value for points at any location on the X Axis ?

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

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

发布评论

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

评论(3

凉栀 2024-12-16 05:55:53

只需使用标准 Interpolation 函数:

rsInterpolation = Interpolation@rs;
Plot[rsInterpolation@x, {x, 400, 700}]

Result

如果您想拟合特定类别的函数 (例如正态分布),而是使用 FindFit。

Just use the standard Interpolation function:

rsInterpolation = Interpolation@rs;
Plot[rsInterpolation@x, {x, 400, 700}]

Result

If you want to fit a specific class of functions (such as a normal distribution), instead use FindFit.

或十年 2024-12-16 05:55:53

如果您需要良好的导数,您可以执行以下操作:

interp = Interpolation[rs, InterpolationOrder -> 3, Method -> "Spline"]
Show[Plot[{interp[x], 10 interp'[x]}, {x, Min[First /@ rs], Max[First /@ rs]},
          PlotRange -> Full],
     ListPlot@rs]

描述">

interp  = Interpolation[rs, InterpolationOrder -> 3, Method -> "Spline"]
interp1 = Interpolation[rs, InterpolationOrder -> 3]
Show[Plot[{interp1'[x], interp'[x] - .005}, 
          {x, Min[First /@ rs], Max[First /@ rs]}, PlotRange -> Full]]

在此处输入图像描述

If you need nice derivatives, you may do something like:

interp = Interpolation[rs, InterpolationOrder -> 3, Method -> "Spline"]
Show[Plot[{interp[x], 10 interp'[x]}, {x, Min[First /@ rs], Max[First /@ rs]},
          PlotRange -> Full],
     ListPlot@rs]

enter image description here

Look at the difference in the derivative's behavior when you use the "Spline" Method:

interp  = Interpolation[rs, InterpolationOrder -> 3, Method -> "Spline"]
interp1 = Interpolation[rs, InterpolationOrder -> 3]
Show[Plot[{interp1'[x], interp'[x] - .005}, 
          {x, Min[First /@ rs], Max[First /@ rs]}, PlotRange -> Full]]

enter image description here

七七 2024-12-16 05:55:53

如果它是一个发行版,我认为你应该使用 SmoothKernelDistribution 代替。

If it is a distribution, I think you should use SmoothKernelDistribution instead.

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