Specify clamped knot vector in bs-call

◇◆丶佛笑我妖孽 提交于 2019-12-02 08:34:26

Judging from your 'parameter' and 'knots' data, indeed they violate the Schoenberg-Whitney condition. I am not familiar with the syntax in R, but it seems that you are generating the knot values uniformly between path$distance[1] and path$distance[12]. This is not right. You should generate your knot values in the following way:

0) Denote the parameters as p[i], where i = 0 to (n-1), p[0]=0.0 and n is number of points. For your case, n=12
1) Create the knot values as

knot[0] = (p[1]+p[2]+p[3])/3
knot[1] = (p[2]+p[3]+p[4])/3
knot[2] = (p[3]+p[4]+p[5])/3
......
These are the interior knot values. You should notice that p[0] and p[n-1] will not be used in this step. You should obtain 8 interior knot values for your case.
2) Now, add p[0] to the front of the knot values 4 times (for degree=3) and add p[n-1] to the end of the knot values 4 times and you are done. For your case, you should get 16 knot values in total.

Please note that this is not the only way to generate a valid knot vector. But knot vector generated in this way will always satisfy the Shoenberg-Whitney condition.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!