我一直在尝试几个软件包来计算正交格根鲍尔多项式的基础,它似乎是正交的[-1,1]。使用软件包midasml
,但我得到了不同的结果:
library(midasml)
x <- seq(-1, 1, length.out = 100)
matplot(B <- gb(degree = 3, alpha = 1, a = -1, b = 1, jmax = NULL, X = x), type="l")
round(t(B) %*% B, 3) #not orthonormal
字符串
有什么原因吗?有什么建议吗?谢谢!
1条答案
按热度按时间du7egjpx1#
正交性并不意味着这个矩阵是正交的。它意味着如果
i != j
,则P_i(x)P_j(x)w(x)
从-1到1的积分为0,如果i = j
,则为1,其中w
是权重函数。参数为alpha
的Gegenbauer多项式的权重函数为(1 - x^2)^(alpha - 1/2)
。你可以用orthopolynom包得到这些多项式。
字符串
这里
P_i(x)²w(x)
的积分不是1,因为我取了normalized = FALSE
。