Thank you very much for your help!
Hailey
Why not? Try it!
x = sort(randn(20,1));
y = -cos(x);
Obviously, a local minimum will occur at x = 0.
Can an optimizer find that point, off of an
interpolated spline? Remember that the spline
is actually only an approximation to the true
curve, so it might not always be perfect.
spl = csapi(x,y);
fun = @(X) fnval(spl,X);
LB = min(x);
UB = max(x);
Xstart = 0.5;
opts = optimset('Largescale','off','Display','off');
Xmin = fmincon(fun,Xstart,[],[],[],[],LB,UB,[],opts)
Xmin =
-5.1909e-06
HTH,
John
"John D'Errico" <wood...@rochester.rr.com> wrote in message
news:gbvk24$a2m$1...@fred.mathworks.com...
Another seperate question is that: is it possible to do so for multivariate spline approximation?
Thank you very much!
Hailey
"Stuart Kozola" <sko...@mathworks.com> wrote in message <gc0i54$5c6$1...@fred.mathworks.com>...
Yes. A spline is a piecewise polynomial model,
that approximates your function from your
data points. The knots or break points specify
the locations where the pieces are tied together.
> In that case, will there be any problem with optimizing each region and then comparing the optimums to get the global optimum?
Why should there be a problem?
> I guess there is a question sort of embeded in this question, which is whether the polynomial function is always convex at the positive variable region (since variables are positive in my problem).
There is no such constraint on a spline such
that it satisfies any convexity constraints, at
least unless you have constructed the spline
such that this is true.
> Another seperate question is that: is it possible to do so for multivariate spline approximation?
Yes.
John
Hi,
I think that you can find some answers by looking at the work conducted by Richard Murray at Caltech university for real-time trajectory optimization by flatness approach. B-splines are used to parameterized the optimization variables (flat outputs), and the B-splines control points are then optimized by an efficient NLP solver (NPSOL by Stanford laboratory), better than fmincon!
Cheers,
V. Morio
PhD student in Automatic Control
IMS lab./University of Bordeaux, France
I tried to use csapi, but it doesn't work once my variables x becomes a matrix, which seems suggesting that it only works for univariate approximation.
In the help file, the only relevant command to do multivariate spline is "stform", but I don't quite understand how this works even after I read the help file. Also it is said in the help file that: "At present, the toolbox works with just one kind of stform, namely a bivariate thin-plate spline and its first partial derivatives. ". Does this mean that it won't work if my function is determined by more than two variables?
Will there be other functions/commands that can do multivariate spline approximation that I missed?
Hailey
"John D'Errico" <wood...@rochester.rr.com> wrote in message <gc67f2$pnu$1...@fred.mathworks.com>...
Thank you for the information. Can I ask if the solver that they developed is publicly available?
Hailey
"Vincent Morio" <vincen...@mathworks.com> wrote in message <gc8von$irn$1...@fred.mathworks.com>...