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.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 . > 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