用法:
numpy.polynomial.hermite_e.hermevander(x, deg)
给定度数的Pseudo-Vandermonde矩阵。
返回度数为M的pseudo-Vandermonde矩阵和采样点x。 pseudo-Vandermonde矩阵定义为
其中0 <= i <=度V的前导索引将x的元素索引,最后一个索引是HermiteE多项式的次数。
如果c是系数n +1的一维数组,而V是该数组
V = hermevander(x, n)
, 然后np.dot(V, c)
和hermeval(x, c)
四舍五入都是一样的。这种等效性对于最小二乘拟合和评估相同程度和采样点的大量HermiteE Series 都是有用的。参数: - x: : array_like
点数组。取决于任何元素是否复杂,dtype将转换为float64或complex128。如果x为标量,则将其转换为一维数组。
- deg: : int
所得矩阵的度。
返回值: - vander: : ndarray
pseudo-Vandermonde矩阵。返回矩阵的形状为
x.shape + (deg + 1,)
,其中最后一个索引是对应的HermiteE多项式的次数。 dtype将与转换后的x相同。
例子:
>>> from numpy.polynomial.hermite_e import hermevander >>> x = np.array([-1, 0, 1]) >>> hermevander(x, 3) array([[ 1., -1., 0., 2.], [ 1., 0., -1., -0.], [ 1., 1., 0., -2.]])
源码:
numpy.polynomial.hermite_e.hermevander的API实现见:[源代码]
注:本文由纯净天空筛选整理自 numpy.polynomial.hermite_e.hermevander。非经特殊声明,原始代码版权归原作者所有,本译文的传播和使用请遵循“署名-相同方式共享 4.0 国际 (CC BY-SA 4.0)”协议。