You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gilles Sadowski <gi...@harfang.homelinux.org> on 2011/08/31 18:09:32 UTC

[Math] Jacobian dimensions in "AbstractLeastSquaresOptimizer"

Hello.

In the "AbstractLeastSquaresOptimizer" class (package "optimization"), there
is (at lines 238-247):
---CUT---
        jF = f.jacobian();
        this.residuals = new double[target.length];

        // Arrays shared with the other private methods.
        point = startPoint.clone();
        rows = target.length;
        cols = point.length;

        weightedResidualJacobian = new double[rows][cols];
        this.weightedResiduals = new double[rows];
---CUT---

Is it necessary to impose the layout of "jF"? Indeed, depending on the
implementation of the "jacobian()" method, one could have
---CUT---
        rows = point.length;
        cols = target.length;
---CUT---
instead. And it is not obvious from the documentation which it should be.

If which data goes into which of the matrix dimensions is not important, is
a way to specify which is which, so that both layout can be used (at the
user's discretion)?

If the layout cannot be decided by the user, it should probably stand out
somewhere in the documentation.


Best regards,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [Math] Jacobian dimensions in "AbstractLeastSquaresOptimizer"

Posted by Luc Maisonobe <Lu...@free.fr>.
Le 02/09/2011 00:29, Gilles Sadowski a écrit :
> Hello Luc.
>
>>> [...]
>>
>> In fact, I have always seen Jacobians using this layout, so from my
>> point of view it was standard. I am conforted in this view by
>> <http://mathworld.wolfram.com/Jacobian.html>.
>
> That goes without saying, but it does not harm to say it anyway. :-)
> [I just happened to pick the wrong layout because it looked more natural for
> looping...]
>
>> So I would prefer to see improved documentation rather than
>> providing a non-standard layout. I think you have already done this
>> doc improvement (I am trying to read all the mails that have arrived
>> during my 2 days unconnected ...)
>
> Yes, I've added a note in the "AbstractLeastSquares" class comment.
> Please check that it is clear enough.

Yes, it is clear.

Thanks,
Luc

>
>
> Best,
> Gilles
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [Math] Jacobian dimensions in "AbstractLeastSquaresOptimizer"

Posted by Gilles Sadowski <gi...@harfang.homelinux.org>.
Hello Luc.

> > [...]
> 
> In fact, I have always seen Jacobians using this layout, so from my
> point of view it was standard. I am conforted in this view by
> <http://mathworld.wolfram.com/Jacobian.html>.

That goes without saying, but it does not harm to say it anyway. :-)
[I just happened to pick the wrong layout because it looked more natural for
looping...]

> So I would prefer to see improved documentation rather than
> providing a non-standard layout. I think you have already done this
> doc improvement (I am trying to read all the mails that have arrived
> during my 2 days unconnected ...)

Yes, I've added a note in the "AbstractLeastSquares" class comment.
Please check that it is clear enough.


Best,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [Math] Jacobian dimensions in "AbstractLeastSquaresOptimizer"

Posted by Luc Maisonobe <Lu...@free.fr>.
Le 31/08/2011 18:09, Gilles Sadowski a écrit :
> Hello.

Hi Gilles,

>
> In the "AbstractLeastSquaresOptimizer" class (package "optimization"), there
> is (at lines 238-247):
> ---CUT---
>          jF = f.jacobian();
>          this.residuals = new double[target.length];
>
>          // Arrays shared with the other private methods.
>          point = startPoint.clone();
>          rows = target.length;
>          cols = point.length;
>
>          weightedResidualJacobian = new double[rows][cols];
>          this.weightedResiduals = new double[rows];
> ---CUT---
>
> Is it necessary to impose the layout of "jF"? Indeed, depending on the
> implementation of the "jacobian()" method, one could have
> ---CUT---
>          rows = point.length;
>          cols = target.length;
> ---CUT---
> instead. And it is not obvious from the documentation which it should be.
>
> If which data goes into which of the matrix dimensions is not important, is
> a way to specify which is which, so that both layout can be used (at the
> user's discretion)?
>
> If the layout cannot be decided by the user, it should probably stand out
> somewhere in the documentation.

In fact, I have always seen Jacobians using this layout, so from my 
point of view it was standard. I am conforted in this view by 
<http://mathworld.wolfram.com/Jacobian.html>.

So I would prefer to see improved documentation rather than providing a 
non-standard layout. I think you have already done this doc improvement 
(I am trying to read all the mails that have arrived during my 2 days 
unconnected ...)

best regards,
Luc

>
>
> Best regards,
> Gilles
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org