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

 
 

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

Submitter:  None
Submitted:  Sun 07 Feb 2021 02:25:25 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  i7tiol
Originator Name:  Daniel Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 6.1.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 08 Jun 2021 05:19:35 AM UTC, comment #4: 

I'm closing this, it can be re-opened if needed.

Olaf Till <i7tiol>
Group Member
Wed 10 Feb 2021 07:42:33 PM UTC, comment #3: 

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

https://sourceforge.net/p/octave/optim/ci/181ff2e574f0c3b10309def8d3fc7f0fc014b6c2/

Olaf Till <i7tiol>
Group Member
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:
https://sourceforge.net/p/octave/optim/ci/default/tree/inst/private/__residmin_stat__.m#l369

    ## 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);
    endif


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

Possibly introduced with this changeset:
https://sourceforge.net/p/octave/optim/ci/f35fa39838a1#diff-4

Markus Mützel <mmuetzel>
Group administrator
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>
Group Member
Sun 07 Feb 2021 02:25:25 PM UTC, original submission:  

#Input:
if (~exist('nonlin_residmin', 'file'))
  pkg load optim;
endif

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));

#Output
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

Anonymous

 

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

Attach Files:
   
   
Comment:
   

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-06-08 i7tiol StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2021-02-10 i7tiol StatusNone Ready For Test
        Assigned toNone i7tiol
    2021-02-07 siko1056 CategoryOctave Function Octave 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.13-758e.
    Corresponding source code