Azzera filtri
Azzera filtri

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

3 visualizzazioni (ultimi 30 giorni)
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 Commenti
Yutao Wang
Yutao Wang il 25 Mag 2021
Modificato: Yutao Wang il 25 Mag 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 il 26 Mag 2021
Modificato: Torsten il 26 Mag 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".

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Polynomials in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by