help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fminsearch does not move


From: Juan Pablo Carbajal
Subject: Re: fminsearch does not move
Date: Wed, 10 Oct 2012 17:51:49 +0200

On Wed, Oct 10, 2012 at 5:37 PM, Martijn Brouwer
<address@hidden> wrote:
> Hi,
> I am trying to do a 2D non-linear least squares optimisation. I have
> image data and would like to subtract a profile that is defined using 6
> parameters. For 1D data I always use leasqr, but as far as I could
> determine fminsearch or fmins are the best options for optimisation on a
> 2D domain.
> The problem I encounter is that the final fitting parameters returned by
> fminsearch are identical to the initial parameters. What is wrong here?
>
> Martijn
>
>
> function z=profile(xx, yy, rr, p)
>   z = p(1)*(1 + p(2)*xx + p(3)*yy + p(4)*xx.^2 +
> p(5)*yy.^2).*exp(rr*p(6));
> end
>
> f = @(p) sum(sum((QImg - profile(xx,yy,r, p)).^2))/n;
>
> p0=[1, sx, sy, sx2, sy2, 0];
>
> z0 = profile(xx,yy,r, p0);
>
> p = fminsearch(f, p0);
>
>
> xx, yy, and r are predefined matrices with the x, y and radial
> coordinates of the pixels. From commandline I can evaluate f(p), but
> apparently fmisearch has a problem with my function.
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave

Hi,
I do not have an answer for you but alternatives.

Have you tried using regress_gp (it is a simple implementation of
regression using gaussian processes). See the demos for nonlinear
regression.
https://sourceforge.net/p/octave/code/11233/tree/trunk/octave-forge/main/statistics/inst/regress_gp.m

Also you could try using sqp for the optimization.

Cheers

-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]