Find the best fit 2 piecewise polynomial function for a data set with 1 optimal breakpoint location

3 次查看(过去 30 天)
I have a 2D data set (2 variables x and y). I would like to use 2 piecewise polynomial functions with 1 breakpoint to best fit the dataset.
For example, function 1 = polynomial1 for mini_data < t < a and function 2 = polynomial2 for a<t<max_data. Also, I need to find the optimal breakpoint a value.
What maths tool/algorithm should I use, please?
Thanks in advance!
  3 个评论
Yutao Wang
Yutao Wang 2021-5-25
编辑:Yutao Wang 2021-5-25
Thanks, @Torsten.
Any degree of polynomial is fine, perhaps degree = 2 to 6 is preferred.
At breapoint, it needs to be continuous + continuity of the first derivative. An example of the data is given here. Thanks in advance!
Torsten
Torsten 2021-5-26
编辑:Torsten 2021-5-26
min: sum_{i=1}^{i=ndata} (p(xdata(i),a) - ydata(i))^2
subject to
p1(a,a) = p2(a,a)
p1'(a,a) = p2'(a,a)
xdata(1) <= a <= xdata(ndata)
with
p(x,a) = p1(x,a) for x<=a
p(x,a) = p2(x,a) for x>=a
Parameters to be optimized are a and the coefficients of the polynomials p1 and p2.
A typical application for Matlab's "fmincon".

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Polynomials 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by