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

 
 

bug #43118: Missing function lscov

Submitted by:  Nir Krakauer <nir_krakauer>
Submitted on:  Sun 31 Aug 2014 11:43:47 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Nir KrakauerOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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 File(s):
   
   
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
  • -unavailable- added by dastew (Updated the item)
  • -unavailable- added by pantxo (Updated the item)
  • -unavailable- added by nir_krakauer (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 30 Nov 2014 02:57:44 AM UTCdastewAttached File-=>Added 19369.patch, #32573
    Mon 06 Oct 2014 04:01:08 PM UTCdastewAttached File-=>Added 19227.patch, #32232
    Mon 08 Sep 2014 06:33:57 AM UTCpantxoStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Sun 07 Sep 2014 09:38:58 AM UTCpantxoStatusNone=>Ready For Test
    Fri 05 Sep 2014 12:52:35 PM UTCnir_krakauerAttached File-=>Added lscov.m, #32029
    Fri 05 Sep 2014 09:05:12 AM UTCpantxoAttached File-=>Added lscov.m, #32028
    Sun 31 Aug 2014 11:43:47 PM UTCnir_krakauerAttached File-=>Added lscov.m, #32003

    Back to the top


    Powered by Savane 3.1-cleanup1