Mr. D'Errico,
Thank you for all the help. The paper you referenced was very
helpful.
Again, thank you for all your time.
Post by Tiago Falkthis
Post by Tiago Falkpolynomial has to be constrained to be monotonically increasing
in the
Post by Tiago Falkrange min(x) to max(x). I'm wondering if anyone has any code
(preferably Matlab) available that will help me out. I've tried
using
Post by Tiago Falk(with no success) the lsqlin function from Matlab, but haven't
succeeded. Please help!!!
Thanks for your time
Its actually not that hard... (famous last words)
If you look in the paper I cite below, you will find a
convex region which will contain all monotone cubic
polynomial segments. The region has one elliptical
boundary. The paper applies this result to cubic "spline"
interpolation, but it can also apply to a least squares
solution. Merely express this region approximately as a
set of linear inequalities, and you can solve the problem
using lsqlin. If you are willing to put it into fmincon,
then you can define the exact region as a nonlinear
inequality constraint.
The lsqlin solution with linear inequalities approximating
the boundary will result in a sufficient condition for
monotonicity. (i.e., the result will be assuredly monotone,
but there may be some monotone cubic polynomials which
were not allowed by the constraint. It depends upon how
good of an approximation you make.) An alternative is to
sample the polynomial over the region, then constrain the
first derivative of the polynomial at that set of points.
These constraints will be linear in the polynomial
coefficients, but it is possible that the resulting
solution may be slightly non-monotone. Thus this approach
will form a set of necessary conditions for monotonicity.
(It is also very easy to implement using lsqlin.)
You have a choice. If you want to solve it as a "linear"
problem using lsqlin, then you can have either a necessary
or sufficient solution for monotonicity, but not both.
The sufficient solution is the one I strongly prefer,
but it does take more work. I prefer the sufficient
approach because slightly non-monotone makes almost
as much sense to me as being slightly pregnant.
In the event that all of this seems hopelessly, insanely
difficult, respond back to this group and I can put
together a simple code in a few days when I get some
time. In that event, let me know your preference.
F.N. Fritsch, R.E. Carlson; ³Monotone Piecewise Cubic
Interpolation²; SIAM Journal on Numerical Analysis;
1980; Vol. 17; No.2; 238-246
HTH,
John D'Errico
--
There are no questions "?" about my real address.
The best material model of a cat is another, or
preferably the same, cat.
A. Rosenblueth, Philosophy of Science, 1945