help-octave
[Top][All Lists]
Advanced

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

Re: leasqr minimization and distance functions


From: Olaf Till
Subject: Re: leasqr minimization and distance functions
Date: Sun, 16 Oct 2011 00:04:23 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Sat, Oct 15, 2011 at 11:30:39AM -0700, octaveuser001 wrote:
> Hi,
>  I have a question on the usage of leasqr function for non-linear least
> squares.
>  I have a set of N 3D points and i have to fit a geometric model to it. 
> Lets say the geometric model has 5 DOF i.e it is parameterized by 5
> variables and N >> 5. I have a distance function that determines the
> distance of the 3D point to a given model. 
>  
>   My objective is to find the 5 parameters from the N points such that the
> total distance is minimized and close to zero. If we want to formulate it in
> least squares sense and use leasqr (which uses non-linear
> Levenberg-Marquardt), i have 
>  [f,pout] = leasqr(pts,zeros(N,1),pin,distfunc);
>  where pin is my initial parameter vector (of length 5 here) and distfunc is
> a handle to the distance function and pout is the expected output.
> 
>  The confusion i have here is my observed variables (i.e y) will be zeros,
> since i want the (distance) values to be zero. This sounds a bit different
> from a normal regression and i am not sure if leasqr will give stable
> results for this use-case.

It's ok. to do it this way. There is also the function 'nonlin_residmin',
which uses the same algorithm as 'leasqr' but would allow you to give
the arguments in a more natural way. But specifying y=zeros() to 'leasqr'
is equivalent and should work (if there are no further problems).

Olaf



reply via email to

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