numarray.linear_algrebra > cholesky_decomposition problem
![](https://secure.gravatar.com/avatar/65e540bbb66ab22e0025f3fe282d8457.jpg?s=120&d=mm&r=g)
Hi, I'm having problems using the cholesky decomposition function - perhaps someone could point out where I am going wrong. Many thanks, Justin dingy /ms/user/w/worrall 22$ python Python 2.3 (#1, Aug 19 2003, 16:53:06) [GCC 2.95.2 19991024 (release)] on sunos5 Type "help", "copyright", "credits" or "license" for more information.
-- This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned or an official confirmation. Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers. This may refer to a research analyst/research report. Unless indicated, these views are the author?s and may differ from those of Morgan Stanley research or others in the Firm. We do not represent this is accurate or complete and we may not update this. Past performance is not indicative of future returns. For additional information, research reports and important disclosures, contact me or see https://secure.ms.com/servlet/cls. You should not use email to request, authorize or effect the purchase or sale of any security or instrument, to send transfer instructions, or to effect any other transactions. We cannot guarantee that any such requests received via email will be processed in a timely manner. This communication is solely for the addres
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
It's a bug in the recent port of mlab.py. Numarray doesn't really support spacesaver, and it doesn't fake it yet either. I removed the spacesaver code for numarray-0.7. On Fri, 2003-08-29 at 04:04, Justin Worrall wrote:
-- Todd Miller <jmiller@stsci.edu>
![](https://secure.gravatar.com/avatar/c895e821a96d85b6f114a09f5a929946.jpg?s=120&d=mm&r=g)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Todd Miller wrote: | It's a bug in the recent port of mlab.py. Numarray doesn't really | support spacesaver, and it doesn't fake it yet either. I removed | the spacesaver code for numarray-0.7. | | On Fri, 2003-08-29 at 04:04, Justin Worrall wrote: | |>Hi, |> |>I'm having problems using the cholesky decomposition function - |>perhaps someone could point out where I am going wrong. Many thanks, |> |>Justin |> |>dingy /ms/user/w/worrall 22$ python |>Python 2.3 (#1, Aug 19 2003, 16:53:06) |>[GCC 2.95.2 19991024 (release)] on sunos5 |>Type "help", "copyright", "credits" or "license" for more information. |> |>>>>from numarray import * |>>>>from numarray.linear_algebra import * |>>>>x=array([[1.0,0.0],[0.5,1.0]]) |>>>>x |> |>array([[ 1. , 0. ], |> [ 0.5, 1. ]]) |> |>>>>cholesky_decomposition(x) |> [snipped] A big Thanks for the *very* quick response. But I found it strange that Cholesky decomposition is used for an unsymmetric matrix and then I discover that in fact this goes through raising no error. Here's the code snippet <quote> from numarray import * import numarray.linear_algebra as la # Good x=array([[1.0,0.5],[0.5,1.0]]) print "\n", x al=la.cholesky_decomposition(x) print "\n", al print "\n", matrixmultiply(al,transpose(al)) # Bad x=array([[1.0,0],[0.5,1.0]]) print "\n", x al=la.cholesky_decomposition(x) print "\n", al print "\n", matrixmultiply(al,transpose(al)) <quote> and the results: <quote> H:\>python chol-numarray.py [[ 1. 0.5] ~ [ 0.5 1. ]] [[ 1. 0. ] ~ [ 0.5 0.8660254]] [[ 1. 0.5] ~ [ 0.5 1. ]] [[ 1. 0. ] ~ [ 0.5 1. ]] [[ 1. 0. ] ~ [ 0.5 0.8660254]] [[ 1. 0.5] ~ [ 0.5 1. ]] </quote> It appears that there is no checking (at least) for the symmetry of the matrix. Of course, the user's responsibilty, ultimately ... Regards, ST -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (MingW32) iD8DBQE/UDKdNmKlQkqct/IRAqIMAJ9T2xg/45Cf08SD4jvy5M4QBrNFvgCcDvrZ PVxuUjQmVmXfSmm0WGilFhE= =1aji -----END PGP SIGNATURE-----
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
It's a bug in the recent port of mlab.py. Numarray doesn't really support spacesaver, and it doesn't fake it yet either. I removed the spacesaver code for numarray-0.7. On Fri, 2003-08-29 at 04:04, Justin Worrall wrote:
-- Todd Miller <jmiller@stsci.edu>
![](https://secure.gravatar.com/avatar/c895e821a96d85b6f114a09f5a929946.jpg?s=120&d=mm&r=g)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Todd Miller wrote: | It's a bug in the recent port of mlab.py. Numarray doesn't really | support spacesaver, and it doesn't fake it yet either. I removed | the spacesaver code for numarray-0.7. | | On Fri, 2003-08-29 at 04:04, Justin Worrall wrote: | |>Hi, |> |>I'm having problems using the cholesky decomposition function - |>perhaps someone could point out where I am going wrong. Many thanks, |> |>Justin |> |>dingy /ms/user/w/worrall 22$ python |>Python 2.3 (#1, Aug 19 2003, 16:53:06) |>[GCC 2.95.2 19991024 (release)] on sunos5 |>Type "help", "copyright", "credits" or "license" for more information. |> |>>>>from numarray import * |>>>>from numarray.linear_algebra import * |>>>>x=array([[1.0,0.0],[0.5,1.0]]) |>>>>x |> |>array([[ 1. , 0. ], |> [ 0.5, 1. ]]) |> |>>>>cholesky_decomposition(x) |> [snipped] A big Thanks for the *very* quick response. But I found it strange that Cholesky decomposition is used for an unsymmetric matrix and then I discover that in fact this goes through raising no error. Here's the code snippet <quote> from numarray import * import numarray.linear_algebra as la # Good x=array([[1.0,0.5],[0.5,1.0]]) print "\n", x al=la.cholesky_decomposition(x) print "\n", al print "\n", matrixmultiply(al,transpose(al)) # Bad x=array([[1.0,0],[0.5,1.0]]) print "\n", x al=la.cholesky_decomposition(x) print "\n", al print "\n", matrixmultiply(al,transpose(al)) <quote> and the results: <quote> H:\>python chol-numarray.py [[ 1. 0.5] ~ [ 0.5 1. ]] [[ 1. 0. ] ~ [ 0.5 0.8660254]] [[ 1. 0.5] ~ [ 0.5 1. ]] [[ 1. 0. ] ~ [ 0.5 1. ]] [[ 1. 0. ] ~ [ 0.5 0.8660254]] [[ 1. 0.5] ~ [ 0.5 1. ]] </quote> It appears that there is no checking (at least) for the symmetry of the matrix. Of course, the user's responsibilty, ultimately ... Regards, ST -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (MingW32) iD8DBQE/UDKdNmKlQkqct/IRAqIMAJ9T2xg/45Cf08SD4jvy5M4QBrNFvgCcDvrZ PVxuUjQmVmXfSmm0WGilFhE= =1aji -----END PGP SIGNATURE-----
participants (3)
-
Justin Worrall
-
LUK ShunTim
-
Todd Miller