octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #66420] Rows and columns mixed up in sqp


From: anonymous
Subject: [Octave-bug-tracker] [bug #66420] Rows and columns mixed up in sqp
Date: Fri, 15 Nov 2024 14:00:38 -0500 (EST)

Follow-up Comment #2, bug #66420 (group octave):

[comment #1 comment #1:]
> I think that the octave documentation is correct

I don't think so, let me explain please.

> It corresponds to the mathematical derivative convention for vectors
> depending on several variables. See for example
> 
> https://en.wikipedia.org/wiki/Matrix_calculus

Let's look at concrete formulas. In the following I refer to this version:

https://en.wikipedia.org/w/index.php?title=Matrix_calculus&oldid=1256945549

In section "Scope", second formula for nabla-f:

nabla f = [some row vector] transposed

This image/formula does NOT work like Octave does, as demonstrated in my
original post:

#g_grad = @(x) transpose([0 0]); # does not work


Further down, in the "vector-by-vector" section, we find a formula that is
consistent with Octave's actual behavior:

dy/dx = [dy1/dx1, dy1/dx2, ...;
         dy2/dx1, dy2/dx2, ...;
         ...]
> 
> (using "transpose" command is only required when the provided derivative
> matrix follows the convention described in the link)   
> 

The transpose command is *not* required because Octave expects the derivatives
with respect to the second variable (x2) in _column_ 2 (as in the cited matrix
above), not row 2, even though the documentation currently wrongly suggests
the latter, i.e. Octave's current documentation wrongly says transpose([f/dx_1
f/dx_2 ...]), which means that the derivative with respect to the second
variable (x_2) would be in _row_ 2 (which is wrong and should be _column_ 2).

I therefore still believe the documentation is wrong (while you are right that
the actual implementation indeed corresponds to the mathematical derivative
convention for vectors depending on several variables).


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66420>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature


reply via email to

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