[Numpy-discussion] matrix norm
I'm curious why scipy/numpy defaults to calculating the Frobenius norm for matrices [1], when Matlab, Octave, and Mathematica all default to calculating the induced 2-norm [2]. Is it solely because the Frobenius norm is easier to calculate, or is there some other good mathematical reason for doing things differently? Thanks, Jason [1] http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.norm.html [2] * Matlab (http://www.mathworks.com/help/matlab/ref/norm.html). * Octave (http://www.network-theory.co.uk/docs/octave3/octave_198.html). * Mathematica (http://reference.wolfram.com/mathematica/ref/Norm.html) ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix norm
On Mon, Oct 22, 2012 at 9:44 AM, Jason Grout jason-s...@creativetrax.comwrote: I'm curious why scipy/numpy defaults to calculating the Frobenius norm for matrices [1], when Matlab, Octave, and Mathematica all default to calculating the induced 2-norm [2]. Is it solely because the Frobenius norm is easier to calculate, or is there some other good mathematical reason for doing things differently? Looks to me like Matlab, Octave, and Mathematica all default to the Frobenius norm . Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix norm
On 10/22/12 10:56 AM, Charles R Harris wrote: On Mon, Oct 22, 2012 at 9:44 AM, Jason Grout jason-s...@creativetrax.com mailto:jason-s...@creativetrax.com wrote: I'm curious why scipy/numpy defaults to calculating the Frobenius norm for matrices [1], when Matlab, Octave, and Mathematica all default to calculating the induced 2-norm [2]. Is it solely because the Frobenius norm is easier to calculate, or is there some other good mathematical reason for doing things differently? Looks to me like Matlab, Octave, and Mathematica all default to the Frobenius norm . Am I not reading their docs correctly? * Matlab (http://www.mathworks.com/help/matlab/ref/norm.html). n = norm(X) is the same as n = norm(X,2). (and n = norm(X,2) returns the 2-norm of X.) * Octave (http://www.network-theory.co.uk/docs/octave3/octave_198.html). Compute the p-norm of the matrix a. If the second argument is missing, p = 2 is assumed. * Mathematica (http://reference.wolfram.com/mathematica/ref/Norm.html) For matrices, Norm[m] gives the maximum singular value of m. Thanks, Jason ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix norm
On Mon, Oct 22, 2012 at 10:00 AM, Jason Grout jason-s...@creativetrax.comwrote: On 10/22/12 10:56 AM, Charles R Harris wrote: On Mon, Oct 22, 2012 at 9:44 AM, Jason Grout jason-s...@creativetrax.com mailto:jason-s...@creativetrax.com wrote: I'm curious why scipy/numpy defaults to calculating the Frobenius norm for matrices [1], when Matlab, Octave, and Mathematica all default to calculating the induced 2-norm [2]. Is it solely because the Frobenius norm is easier to calculate, or is there some other good mathematical reason for doing things differently? Looks to me like Matlab, Octave, and Mathematica all default to the Frobenius norm . Am I not reading their docs correctly? * Matlab (http://www.mathworks.com/help/matlab/ref/norm.html). n = norm(X) is the same as n = norm(X,2). (and n = norm(X,2) returns the 2-norm of X.) * Octave (http://www.network-theory.co.uk/docs/octave3/octave_198.html). The 2-norm and the Frobenius norm are the same thing. Compute the p-norm of the matrix a. If the second argument is missing, p = 2 is assumed. * Mathematica (http://reference.wolfram.com/mathematica/ref/Norm.html) For matrices, Norm[m] gives the maximum singular value of m. OK, looks like Mathematica does return the induced (operator) norm. I didn't see that bit. Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix norm
On Mon, Oct 22, 2012 at 10:56 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Mon, Oct 22, 2012 at 9:44 AM, Jason Grout jason-s...@creativetrax.comwrote: I'm curious why scipy/numpy defaults to calculating the Frobenius norm for matrices [1], when Matlab, Octave, and Mathematica all default to calculating the induced 2-norm [2]. Is it solely because the Frobenius norm is easier to calculate, or is there some other good mathematical reason for doing things differently? Looks to me like Matlab, Octave, and Mathematica all default to the Frobenius norm . Not octave: octave-3.4.0:26 a = [1 2; 3 4] a = 1 2 3 4 The default norm (for a 2x2 matrix) is the spectral norm: octave-3.4.0:27 norm(a) ans = 5.4650 octave-3.4.0:28 norm(a, 2) ans = 5.4650 octave-3.4.0:29 svd(a)(1) ans = 5.4650 not the Frobenius norm: octave-3.4.0:30 norm(a, 'fro') ans = 5.4772 octave-3.4.0:31 sqrt(sum(sum(a.**2))) ans = 5.4772 Warren Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix norm
On 10/22/12 11:08 AM, Charles R Harris wrote: The 2-norm and the Frobenius norm are the same thing. For vectors, but I was talking about matrices and induced p-norms (sorry for not being clear). Warren pointed out that the spectral norm (the induced 2-norm) is used in Octave as the default. Does someone have matlab to test their implementation? The fact that matlab has a separate command for the Frobenius norm indicates that they also may be using the spectral norm for the default matrix norm. Thanks, Jason ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix norm
matlab default is the 2-norm. norm(X) is equivalent to norm(X,2) norm(X,'fro') is the frobenius norm. There are others and some special cases for vectors. http://www.mathworks.com/help/matlab/ref/norm.html On Oct 22, 2012, at 12:14 PM, Jason Grout wrote: On 10/22/12 11:08 AM, Charles R Harris wrote: The 2-norm and the Frobenius norm are the same thing. For vectors, but I was talking about matrices and induced p-norms (sorry for not being clear). Warren pointed out that the spectral norm (the induced 2-norm) is used in Octave as the default. Does someone have matlab to test their implementation? The fact that matlab has a separate command for the Frobenius norm indicates that they also may be using the spectral norm for the default matrix norm. Thanks, Jason ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Announcing Anaconda version 1.1
On Fri, Oct 19, 2012 at 9:10 AM, Travis Oliphant tra...@continuum.io wrote: I just wanted to let everyone know about our new release of Anaconda which now has Spyder and Matplotlib working for Mac OS X and Windows. [snip] For more information, to download a trial version of Anaconda Pro, or download the completely free Anaconda CE, click here. Travis, Just downloaded the linux version of this to try out on a server. When I try to execute the bash script, I get the following message: -bash-3.2$ ./AnacondaCE-1.1-linux.sh ERROR: size of AnacondaCE-1.1-linux.sh should be 248021729 bytes And the file actually is... -bash-3.2$ ls -l total 242452 -rwx--x--x 1 pnrfield pnrfield 248017374 Oct 19 16:39 AnacondaCE-1.1-linux.sh Thanks, -paul ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Announcing Anaconda version 1.1
Sorry for the noise. Using curl to directly grab the file (instead of copying from another machine) does the trick. -paul On Mon, Oct 22, 2012 at 9:50 AM, Paul Hobson pmhob...@gmail.com wrote: On Fri, Oct 19, 2012 at 9:10 AM, Travis Oliphant tra...@continuum.io wrote: I just wanted to let everyone know about our new release of Anaconda which now has Spyder and Matplotlib working for Mac OS X and Windows. [snip] For more information, to download a trial version of Anaconda Pro, or download the completely free Anaconda CE, click here. Travis, Just downloaded the linux version of this to try out on a server. When I try to execute the bash script, I get the following message: -bash-3.2$ ./AnacondaCE-1.1-linux.sh ERROR: size of AnacondaCE-1.1-linux.sh should be 248021729 bytes And the file actually is... -bash-3.2$ ls -l total 242452 -rwx--x--x 1 pnrfield pnrfield 248017374 Oct 19 16:39 AnacondaCE-1.1-linux.sh Thanks, -paul ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix norm
On 10/22/12 10:44 AM, Jason Grout wrote: I'm curious why scipy/numpy defaults to calculating the Frobenius norm for matrices [1], when Matlab, Octave, and Mathematica all default to calculating the induced 2-norm [2]. Is it solely because the Frobenius norm is easier to calculate, or is there some other good mathematical reason for doing things differently? I think we've established that the other software mentioned does indeed use the spectral norm by default. I'm still curious: what was the reason for breaking with the norm (pun intended :)? Any chance that in a (probably far distant) future release, the norm default could be changed to conform with matlab/octave/mathematica's view of the world? It's not a huge deal to me now that I know to watch out for it, but it did just bite me and a student a few times. Thanks, Jason ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix norm
Jason Grout jason-sage at creativetrax.com writes: [clip] I think we've established that the other software mentioned does indeed use the spectral norm by default. I'm still curious: what was the reason for breaking with the norm (pun intended :)? Any chance that in a (probably far distant) future release, the norm default could be changed to conform with matlab/octave/mathematica's view of the world? It's not a huge deal to me now that I know to watch out for it, but it did just bite me and a student a few times. The trail leads to here: http://projects.scipy.org/numpy/attachment/ticket/36/numpy-6-norm-change- default.diff Seems like the chances of learning the reason why this change was done are pretty slim. -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix norm
On Mon, Oct 22, 2012 at 9:03 PM, Pauli Virtanen p...@iki.fi wrote: Jason Grout jason-sage at creativetrax.com writes: [clip] I think we've established that the other software mentioned does indeed use the spectral norm by default. I'm still curious: what was the reason for breaking with the norm (pun intended :)? Any chance that in a (probably far distant) future release, the norm default could be changed to conform with matlab/octave/mathematica's view of the world? It's not a huge deal to me now that I know to watch out for it, but it did just bite me and a student a few times. The trail leads to here: http://projects.scipy.org/numpy/attachment/ticket/36/numpy-6-norm-change- default.diff Seems like the chances of learning the reason why this change was done are pretty slim. http://mail.scipy.org/pipermail/numpy-discussion/2006-March/019194.html -- Robert Kern ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix norm
On 10/22/12 3:03 PM, Pauli Virtanen wrote: Jason Grout jason-sage at creativetrax.com writes: [clip] I think we've established that the other software mentioned does indeed use the spectral norm by default. I'm still curious: what was the reason for breaking with the norm (pun intended :)? Any chance that in a (probably far distant) future release, the norm default could be changed to conform with matlab/octave/mathematica's view of the world? It's not a huge deal to me now that I know to watch out for it, but it did just bite me and a student a few times. The trail leads to here: http://projects.scipy.org/numpy/attachment/ticket/36/numpy-6-norm-change- default.diff Seems like the chances of learning the reason why this change was done are pretty slim. Thanks for tracking this down. It looks like the default used to be the spectral norm. I guess there still is a question of if it is possible to change it back at this point. FYI, in Sage, we were following the numpy convention (default = Frobenius norm) for numerical matrices, but we are now switching the default to be the spectral norm [1]. Thanks, Jason [1] http://trac.sagemath.org/sage_trac/ticket/13643 ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix norm
On 10/22/12 3:08 PM, Robert Kern wrote: http://mail.scipy.org/pipermail/numpy-discussion/2006-March/019194.html Ah, so it was basically speed that was the issue. I won't push this further. I'll just note that I was confused for a bit, and I probably won't be the last person confused about it, given the conventions in the other software packages. Jason ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] matrix norm
In this case, I would say a note in the documentation would be in order, remarking the fact that this default is not what other packages take as default. On Mon, Oct 22, 2012 at 10:16 PM, Jason Grout jason-s...@creativetrax.com wrote: On 10/22/12 3:08 PM, Robert Kern wrote: http://mail.scipy.org/pipermail/numpy-discussion/2006-March/019194.html Ah, so it was basically speed that was the issue. I won't push this further. I'll just note that I was confused for a bit, and I probably won't be the last person confused about it, given the conventions in the other software packages. Jason ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Issue tracking
On Fri, Oct 19, 2012 at 9:34 PM, Thouis (Ray) Jones tho...@gmail.com wrote: On Fri, Oct 19, 2012 at 4:46 PM, Thouis (Ray) Jones tho...@gmail.com wrote: On Fri, Oct 19, 2012 at 11:20 AM, Thouis (Ray) Jones tho...@gmail.com wrote: I started the import with the oldest 75 and newest 125 Trac issues, and will wait a few hours to do the rest to allow feedback, just in case something is broken that I haven't noticed. I did make one change to better emulate Trac behavior. Some Trac usernames are also email addresses, which Trac anonymizes in its display. I decided it was safer to do the same. The import is running again, though I've been having some failures in a few comments and general hangs (these might be network related). I'm keeping track of which issues might have had difficulties. @endolith noticed that I didn't correctly relink #XXX trac id numbers to github id numbers (both trac and github create links automatically), so that will have to be handled by a postprocessing script (which it probably would have, anyway, since the github # isn't known before import). Import has finished. The following trac #s had issues in creating the comments (I think due to network problems): 182, 297, 619, 621, 902, 904, 909 913, 914, 915, 1044, 1526. I'll review them and see if I can pull in anything missing I'll also work on a script for updating the trac crossrefs to github crossrefs. In the no good deed goes unpunished category, I accidentally logged in as myself (rather than numpy-gitbot) and pushed about 500 issues, so now I receive updates whenever one of them gets changed. At least most of them were closed, already... I just updated the cross-issue-references to use github rather than Trac id numbers. Stupidly, I may have accidentally removed comments that were added in the last few days to issues moved from trac to github. Hopefully not, or at least not many. It's probably a good idea to turn off Trac, soon, to keep too many new bugs from needing to be ported, and old bugs being commented on. The latter is more of a pain to deal with. Ray ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion