Re: [ojAlgo-user] 答复: How to compute the (Moore-Penrose) pseudo-inverse of a matrix.
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anders P. <an...@op...> - 2016-04-19 21:12:18
|
Checking the pseudoinverse is part of the unit tests for the SVD implementations, but the tests are typically done with smaller matrices. My guess is, as you also mentioned, that this is probably an accuracy problem that becomes more severe with larger matrices. I’ll have a look at this, but can’t promise anything about the solution. If you have a look inside RawSingularValue and SingularValueDecomposition I believe you’ll find code similar to what’s that page you linked to. Most likely the problem is there. /Anders > On 19 apr. 2016, at 10:19, 常 超 <cha...@ho...> wrote: > > > Hi,Anders > > Difference occured when the size of row or column is big,say a big matrix of 2000*2000. > > With the same input matrix,numpy and the following java code returns almost the same result, > While ojAlgo returns a different value. > > http://the-lost-beauty.blogspot.jp/2009/04/moore-penrose-pseudoinverse-in-jama.html > The basic properties are not met. > > > I used the compare code in the above article to check the property, > numpy and the the implementation in the above article passed, > But ojAlgo failed. > Is it just a problem of accuracy of ojAlgo when calcularing pseudo-inverse for a big matrix? > > boolean c1 = checkEquality(A.times(Aplus).times(A), A); > boolean c2 = checkEquality(Aplus.times(A).times(Aplus), Aplus); > boolean c3 = checkEquality(A.times(Aplus), A.times(Aplus).transpose()); > boolean c4 = checkEquality(Aplus.times(A), Aplus.times(A).transpose()); > > public static boolean checkEquality(Matrix A, Matrix B) { > return A.minus(B).normInf() < 1e-9; > } > > If needed,I can post my test data.(It is in a big test file container the double value of a 2000*2000 matrix,about 77M byte) > > Chao. > ________________________________________ > 发件人: Anders Peterson <an...@op...> > 发送时间: 2016年4月19日 15:07 > 收件人: oja...@li... > 主题: Re: [ojAlgo-user] How to compute the (Moore-Penrose) pseudo-inverse of a matrix. > > It should return the pseudoinverse. How are the results different? > > Please verify these basic properties on both the ojAlgo and numpy results. > > https://en.wikipedia.org/wiki/Moore–Penrose_pseudoinverse#Basic_properties > > If both fulfil those then check which has the smallest frobeninius norm. > > > Let me know what you learn. > > > /Anders > > > >> On 19 apr. 2016, at 04:56, 常 超 <cha...@ho...> wrote: >> >> Hi,everyone. >> >> Is there a way to calculate the (Moore-Penrose) pseudo-inverse of a matrix just as numpy.linalg.pinv() does in python? >> I used SingularValue.makePrimitive().invert(matrix),but the result does not equals to the pinv result. >> >> Reference: >> http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.linalg.pinv.html >> >> Thanks in advance. >> Chao. >> ------------------------------------------------------------------------------ >> Find and fix application performance issues faster with Applications Manager >> Applications Manager provides deep performance insights into multiple tiers of >> your business applications. It resolves application problems quickly and >> reduces your MTTR. Get your free trial! >> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________ >> ojAlgo-user mailing list >> ojA...@li... >> https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |