Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
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 Kommentare
Yutao Wang
Yutao Wang am 25 Mai 2021
Bearbeitet: Yutao Wang am 25 Mai 2021
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 am 26 Mai 2021
Bearbeitet: Torsten am 26 Mai 2021
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".

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Polynomials finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by