bugGNU Octave - Bugs: bug #60018, [octave forge] (optim)...


bug #60018: [octave forge] (optim) residmin_stat gives error when some variables are flagged as fixed.

Submitted by:  None
Submitted on:  Sun 07 Feb 2021 02:25:25 PM UTC  
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Ready For Test Assigned to:  Olaf Till <i7tiol>
Originator Name:  Daniel Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  6.1.0
Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Wed 10 Feb 2021 07:42:33 PM UTC, comment #3: 

Thanks for testing and reporting, should be fixed with this changeset:


Olaf Till <i7tiol>
Project MemberIn charge of this item.
Mon 08 Feb 2021 11:14:40 AM UTC, comment #2: 

This seems to be a regression from optim 1.5.3 to optim 1.6.0 (not a regression in core Octave).

The respective lines in `__resid_min__` are:

    ## model function
    f = @ (p, varargin) f (assign (pfin, o.nonfixed, p), varargin{:});

    ## jacobian of model function
    if (have_dfdp)
      f.dfdp = @ (p, hook) ...
          f.dfdp (assign (orig_p, o.nonfixed, p), hook)(:, o.nonfixed);

The function handle `f` cannot be indexed with `.`.

Possibly introduced with this changeset:

Markus M├╝tzel <mmuetzel>
Project Member
Sun 07 Feb 2021 03:28:30 PM UTC, comment #1: 

From previous title: "The function worked properly in 5.1.0."

Kai Torben Ohlhus <siko1056>
Project Member
Sun 07 Feb 2021 02:25:25 PM UTC, original submission:  

if (~exist('nonlin_residmin', 'file'))
  pkg load optim;

x = [1, 2, 3, 4]';
y = [5.2, 6.9, 8.6, 11.5]';
f = @(x, a) a(1)*x + a(2);
fixed = [false, true]';
p0 = [1, 3]';
r = @(a) (y - f(x, a));
fitparams = nonlin_residmin(r, p0, optimset('fixed', fixed));
stat = residmin_stat(r, fitparams, struct('objf_type', 'wls', 'ret_covp', true, 'fixed', fixed));

error: can't perform indexed assignment for function handle type
error: called from
    _residmin_stat_ at line 369 column 14
    residmin_stat at line 76 column 7
    fitting_test_610 at line 12 column 6



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by i7tiol (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-02-10 i7tiol StatusNone => Ready For Test
        Assigned toNone => i7tiol
    2021-02-07 siko1056 CategoryOctave Function => Octave Forge Package
        Summaryresidmin_stat gives error when some variables are flagged as fixed. The function worked properly in 5.1.0. => [octave forge] (optim) residmin_stat gives error when some variables are flagged as fixed.

    Back to the top

    Powered by Savane 3.5