How many columns can the input to the JacobianMultiplyFcn have?

1 view (last 30 days)
I am using the JacobianMultiplyFcn option of lsqnonlin. The documentation says that JacobianMultiplyFcn is to be a handle to a function jmfun with the syntax,
W = jmfun(Jinfo,Y,flag)
where,
Y is a matrix that has the same number of rows as there are dimensions in the problem. flag determines which product to compute:
  • If flag == 0 then W = J'*(J*Y).
  • If flag > 0 then W = J*Y.
  • If flag < 0 then W = J'*Y.
However, the documentation does not specify how many columns Y will have. I initially assumed Y will always be a column vector, but after some dbstops, I am seeing that this is sometimes, but not always, the case. In particular, I am seeing a situation where flag=0 and Y is Nx2.
So my question is, how many columns can I expect Y to have in the given input. I need to know this so that,
(a) I can plan the implementation of jmfun.
(b) I can know how much RAM might be required per iteration.
Since this option is supposed to be for large scale problems, it seems silly if Y couldn't be counted upon to be "substantially skinny".
  2 Comments
Matt J
Matt J on 2 Feb 2023
So far, I have not seen a case where there are more than 2 columns, but I wonder if that is generally true.

Sign in to comment.

Accepted Answer

Steve Grikschat
Steve Grikschat on 3 Feb 2023
@Matt J: lsqnonlin trust-region-reflective will only call with either
1) M and N dimensional column vectors,
2) An Mx2 matrix,
where M is the number of elements in "F" returned by your objective function and N is the number of design parameters.
The matrix in (2) is comprised of s1 and s2 described here and is used to form the 2-dimensional trust-region subproblem.

More Answers (0)

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!