问题标签 [extrapolation]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - 外推 OutOfRangeException Apache Commons Math
我正在尝试使用 Apache Commons Math 库和 PolynomialSplineFunction 和 LinearInterpolator 函数来实现外推函数。
x = [0, 60, 120,180,240];
y = [196, 232, 250, 157, 300];
xi = [300, 360, 420];
问题是,如果我使用的值超出了x
我得到的范围,OutOfRangeException
有没有办法使用这种方法进行推断?我该如何解决这个错误。
r - 如何推断超出传递给“ksmooth”的x点?
我有一个像这样的内核函数:
如果我尝试在 x 值范围之外的某个点进行预测,它会给我NaN
,因为它试图在数据之外进行推断:
即使我改变range.x
它也不会让步:
我如何获得ksmooth
超出数据外推的函数?我知道这在理论上是一个坏主意,但实际上这个问题一直存在。
python - 在 python 中插入/推断缺少的日期?
假设我有以下数据框
我想线性插值和扩展来填充缺失的日期值。我使用了以下代码,但它没有改变任何东西。我是熊猫新手。请帮忙
c++ - ScatteredInterpolant() 的线性外推如何在 MATLAB 中工作?
对于我的项目,我必须编写一个 C++ 代码,相当于 Matlab 的 ScatteredInterpolant() 函数。我的数据点是三维的分散数据。我能够使用 TetGen 库计算 Delaunay 四面体。我已经使用从 TetGen 和 Matlab 自己的 delaunay() 函数中找到的四面体比较了插值结果,只要查询点在凸包内,结果是相同的。
在我的项目中,我必须使用线性外推法推断凸包外的点。我浏览了 Matlab 文档,上面写着“基于边界梯度的线性外推”。从我的文献调查中,我找不到很好的文档,线性外推是如何使用边界梯度工作的。如果您能向我提供有关线性外推法如何作用于scatteredInterpolant() 的见解,我将不胜感激。
我查看了分散数据外推文档页面,其中说“'线性'外推方法基于凸包边界处梯度的最小二乘近似值。它为查询点之外的查询点返回的值凸包基于边界处的值和梯度。” 为了验证,我编写了以下代码(二维数据):
据我了解,斜率为 2,但为什么外推值不同?我可能会遗漏一些东西。我真的很感激一些见解。
谢谢
date - 谷歌电子表格外推
如何生成与每周重复的周一、周三、周五序列相对应的日期?
例如,如果星期一是 25/7/2016,我希望在一列中有以下序列:
25/7/2016
27/7/2016
2016 年 7 月 29 日
2016 年 1 月 8 日
2016 年 3 月 8 日等。
由于“选择并拖动”推断不起作用,我不知道该怎么做。
matlab - 在 MatLab 中将一个向量(元素较少)除以另一个向量
我有一个N
包含 21 个元素的向量
我首先需要构造另一个向量Nprin=(N_{i+1}-N_{i-1})/20
,所以这就是我构造它的方式
我现在需要除以N
元素Nprin
(让我们称之为y
),但N
有 21 个元素,而Nprin
有 19 个元素,所以我应该如何评估y
?
还是有一种方法可以让我简单地执行以下操作?
triangulation - Extrapolate from triangulation
Suppose we have five vertices:
a triangulation:
and function values defined on the vertices:
then we can easily compute the function value for any point inside the triangle by using the barycentric coordinates. For point P = [1 .5]
, which lies in the first triangle, the barycentric coordinates are B = [.25 .5 .25]
, so the function evaluates to Fxi = 1/4 + 4/2 + 2/4 = 2.75
.
However, I have difficulty to see how one would extrapolate this surface. We could find the closest triangle and extrapolate from that. The problem is that this results in a discontinuous function. Consider e.g. point P = [2 2]
. According to triangle 1, its value would be -0.5, whereas according to triangle 3 its value would be 9.5.
Is there a "standard" or generally accepted approach to extrapolate from piecewise linear functions? Any pointers to existing material also greatly appreciated.