Fit to just half a parabola

4 Ansichten (letzte 30 Tage)
Sven
Sven am 4 Mär. 2015
Bearbeitet: Sven am 4 Mär. 2015
Hi there, I have some simple XY data, and I can fit a quadratic to it as follows:
X = [25.4 30.48 35.56 40.64 45.72 50.8 63.5 76.2];
Y = [12443 9560.9 7381.1 5834.8 4740.6 3926.8 2723.5 2072.4];
p = polyfit(X,Y,2);
x1 = linspace(min(X),max(X),100);
y1 = polyval(p,x1);
figure, plot(X,Y,'o', x1, y1)
What I'd like to do however is to add a constraint and fit only the left half of a parabola. In other words, I would like to constrain my fit such that the underlying model (and therefore result) has a turning point at an X location equal to or greater than my maximum X observation.
How should go about applying such constraints? I'm guessing this is now an optimization toolbox problem rather than just solving a linear set of equations.
Thanks, Sven.

Antworten (0)

Kategorien

Mehr zu Linear and Nonlinear Regression finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by