Path: news.mathworks.com!not-for-mail
From: "Hailey Yang" <haileyyang@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Is it possible to optimize a spline function?
Date: Fri, 3 Oct 2008 21:57:01 +0000 (UTC)
Organization: M.I.T.
Lines: 60
Message-ID: <gc64fd$i3k$1@fred.mathworks.com>
References: <gbug8e$2ae$1@fred.mathworks.com> <gbvk24$a2m$1@fred.mathworks.com> <gc0i54$5c6$1@fred.mathworks.com>
Reply-To: "Hailey Yang" <haileyyang@hotmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1223071021 18548 172.30.248.37 (3 Oct 2008 21:57:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 3 Oct 2008 21:57:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1433718
Xref: news.mathworks.com comp.soft-sys.matlab:493563


Thank you for your reply. My understanding for the spline approximation, which might be wrong, is that the whole region, if necessary, is seperated into different regions and each region is represented by a polynomial function. In that case, will there be any problem with optimizing each region and then comparing the optimums to get the global optimum? 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). 

Another seperate question is that: is it possible to do so for multivariate spline approximation? 

Thank you very much!
Hailey


"Stuart Kozola" <skozola@mathworks.com> wrote in message <gc0i54$5c6$1@fred.mathworks.com>...
> fmincon will get you a local minima.  If your surface is highly nonlinear 
> (has many local minima, or no true global minima) you need to take that into 
> account when you run the optimizer.  Your choice of starting point can be 
> important in getting you to the global minima if there is one.  You might 
> want to run fmincon with multiple start points to ensure that you find the 
> true global and don't get stuck in a local minima.  You could also try 
> Genetic Algorithm or Simulated Annealing which are better at getting out of 
> local minima.
> 
> "John D'Errico" <woodchips@rochester.rr.com> wrote in message 
> news:gbvk24$a2m$1@fred.mathworks.com...
> > "Hailey Yang" <haileyyang@hotmail.com> wrote in message 
> > <gbug8e$2ae$1@fred.mathworks.com>...
> >> As an example, if I use function csapi to approximate the space which are 
> >> defined by some sample points and I let cs=csapi(...), then after I get 
> >> this, is it possible to use some of the optimization functions, such as 
> >> fmincon, to optimize this function and get the optimum? Or, if not using 
> >> those optimization functions, are there other ways to optimize the spline 
> >> function cs?
> >
> >
> > 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
> >
> > 
>