bugGNU Octave - Bugs: bug #43118, Missing function lscov

 
 

bug #43118: Missing function lscov

Submitter:  Nir Krakauer <nir_krakauer>
Submitted:  Sun 31 Aug 2014 11:43:47 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Nir Krakauer Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 01 Dec 2014 08:43:08 PM UTC, comment #15: 

Hi,

Thanks Doug, I pushed the patch after a few edits (added the bug n# and a minimal change log):

http://hg.savannah.gnu.org/hgweb/octave/rev/cc7931e8953d

Pantxo

Pantxo Diribarne <pantxo>
Group Member
Sun 30 Nov 2014 02:57:44 AM UTC, comment #14: 

some of the testes were still failing so I added eps to them

Patch is attached.


(file #32573)

Doug Stewart <dastew>
Mon 06 Oct 2014 04:47:22 PM UTC, comment #13: 

Hi,

I have pushed the changeset at http://hg.savannah.gnu.org/hgweb/octave/rev/4122df73e374

Thanks.

Pantxo Diribarne <pantxo>
Group Member
Mon 06 Oct 2014 04:01:08 PM UTC, comment #12: 

Ok
Here it is.


(file #32232)

Doug Stewart <dastew>
Mon 06 Oct 2014 01:50:24 PM UTC, comment #11: 

Doug-- Yes, please do.

Nir Krakauer <nir_krakauer>
Sun 05 Oct 2014 04:44:27 PM UTC, comment #10: 

I compiled octave and ran a test
doug@speedy:~/octavec/octave$ hg tip
changeset:   19220:6443693a176f
bookmark:    @
tag:         tip

lscov failed  with:

error: ASSERT errors for:  assert (b2,[b, 2 * b])

  Location  |  Observed  |  Expected  |  Reason
   (1,1)        0.1203       0.1203      Abs err 1.3878e-17 exceeds tol 0
   (1,2)       0.24061      0.24061      Abs err 2.7756e-17 exceeds tol 0


if I change to:

assert(b2, [b 2*b] , eps)

then It passes ok.


Do you want me to make a hg change set for this?

Doug Stewart

Anonymous
Mon 08 Sep 2014 06:33:57 AM UTC, comment #9: 

I have moves the script to scripts/statistics. Closing bug report.

Pantxo Diribarne <pantxo>
Group Member
Sun 07 Sep 2014 02:45:30 PM UTC, comment #8: 

OK

Nir Krakauer <nir_krakauer>
Sun 07 Sep 2014 01:22:50 PM UTC, comment #7: 

I'll move the function to scripts/statistics/base.

I removed "regress" from the seealso section as it currently belongs to the statistics package, not octave core.

Pantxo Diribarne <pantxo>
Group Member
Sun 07 Sep 2014 11:56:11 AM UTC, comment #6: 

Couple minor suggestions:

1) Consider putting lscov in statistics (like ols and gls) instead of optimization

2) Add regress under seealso


Otherwise, looks great. You can close the bug report.

Nir Krakauer <nir_krakauer>
Sun 07 Sep 2014 09:38:58 AM UTC, comment #5: 

Hi Nir,

I have added lscov to octave build tree (http://hg.savannah.gnu.org/hgweb/octave/rev/c9113e28fae8).

If you nothing wrong in the commit I'll close this bug report

Pantxo Diribarne <pantxo>
Group Member
Sat 06 Sep 2014 05:41:02 PM UTC, comment #4: 

Based on what lsqnonneg and so on have in the manual, looks like we can pretty much just copy the help text over to that

Nir Krakauer <nir_krakauer>
Sat 06 Sep 2014 05:23:25 PM UTC, comment #3: 

Hi Nir,

Can you suggest a small text to introduce this function in octave manual (in chapter 25.4 maybe [1])?


[1] https://www.gnu.org/software/octave/doc/interpreter/Linear-Least-Squares.html#Linear-Least-Squares

Pantxo Diribarne <pantxo>
Group Member
Fri 05 Sep 2014 12:52:35 PM UTC, comment #2: 

Your changes are generally fine. I made a few small modifications (mostly spelling and style) -- see the attached.

(file #32029)

Nir Krakauer <nir_krakauer>
Fri 05 Sep 2014 09:05:12 AM UTC, comment #1: 

Hi Nir,

I have no expertise in this kind of algorithm but I can make a few formal proposals. I have attached a modified version of your function with the following mods:

  • add space between function names and parens to visually differentiate function calls and matrix indexing,
  • reduce indentation to 2 spaces,
  • enclose boolean expressions after "if" statements between parens,
  • add "endfunction" before tests,
  • add a few input checkings so that calling the function e.g. "lscov (1)" returns a useful error message,


Finally I also reorganized the doc so that it looks more like other octave functions help:

  • list the different ways to call the function in the header, so that it is obvious what input parameter is optional or not,
  • remove the input/output sections in favor of dedicated paragraphs. As an example of a function that have a similar interface, see the help string for "fsolve" function.


Can you tell me if you agree with my proposal?



(file #32028)

Pantxo Diribarne <pantxo>
Group Member
Sun 31 Aug 2014 11:43:47 PM UTC, original submission:  


Candidate implementation attached

Nir Krakauer <nir_krakauer>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #32573:  19369.patch added by dastew (914B - text/x-patch)
file #32232:  19227.patch added by dastew (744B - text/x-patch)
file #32029:  lscov.m added by nir_krakauer (7KiB - text/x-objcsrc)
file #32028:  lscov.m added by pantxo (7KiB - text/x-objcsrc)
file #32003:  lscov.m added by nir_krakauer (6KiB - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dastew (Updated the item)
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by nir_krakauer (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-11-30 dastew Attached File- Added 19369.patch, #32573
    2014-10-06 dastew Attached File- Added 19227.patch, #32232
    2014-09-08 pantxo StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2014-09-07 pantxo StatusNone Ready For Test
    2014-09-05 nir_krakauer Attached File- Added lscov.m, #32029
    2014-09-05 pantxo Attached File- Added lscov.m, #32028
    2014-08-31 nir_krakauer Attached File- Added lscov.m, #32003

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code