请考虑以下分布:
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轴上任何位置的点的值?
答案 0 :(得分:7)
只需使用标准Interpolation
功能:
rsInterpolation = Interpolation@rs;
Plot[rsInterpolation@x, {x, 400, 700}]
如果您想要适合特定类别的函数(例如正态分布),请使用FindFit
。
答案 1 :(得分:5)
如果您需要不错的衍生品,您可以执行以下操作:
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]]
答案 2 :(得分:0)
如果是分发版,我认为您应该使用 SmoothKernelDistribution 。