search for: hinv1

Displaying 4 results from an estimated 4 matches for "hinv1".

Did you mean: hinv
2009 Jun 17
1
Inverting a square matrix using solve() with LAPACK=TRUE (PR#13762)
...l_Name: Ravi Varadhan Version: 2.8.1 OS: Windows Submission from: (NULL) (162.129.251.19) Inverting a matrix with solve(), but using LAPACK=TRUE, gives erroneous results: Here is an example: hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") } h5 <- hilbert(5) hinv1 <- solve(qr(h5)) hinv2 <- solve(qr(h5, LAPACK=TRUE)) all.equal(hinv1, hinv2) # They are not equal Here is a function that I wrote to correct this problem: solve.lapack <- function(A, LAPACK=TRUE, tol=1.e-07) { # A function to invert a matrix using "LAPACK" or "LINPAC...
2009 Jun 18
1
Inverting a square... (PR#13762)
...(p)] which should be [seq_len(p),] (otherwise, in the matrix case, the RHS will recycle only the 1st p elements, i.e., the 1st column). >=20 > Here is an example: >=20 > hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") } > h5 <- hilbert(5) > hinv1 <- solve(qr(h5)) > hinv2 <- solve(qr(h5, LAPACK=3DTRUE))=09 > all.equal(hinv1, hinv2) # They are not equal >=20 > Here is a function that I wrote to correct this problem: >=20 > solve.lapack <- function(A, LAPACK=3DTRUE, tol=3D1.e-07) { > # A function to invert a...
2009 Jun 18
0
Inverting a square matrix using solve() with LAPACK=TRUE (PR#13765)
...len(p)] which should be [seq_len(p),] (otherwise, in the matrix case, the RHS will recycle only the 1st p elements, i.e., the 1st column). > > Here is an example: > > hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") } > h5 <- hilbert(5) > hinv1 <- solve(qr(h5)) > hinv2 <- solve(qr(h5, LAPACK=TRUE)) > all.equal(hinv1, hinv2) # They are not equal > > Here is a function that I wrote to correct this problem: > > solve.lapack <- function(A, LAPACK=TRUE, tol=1.e-07) { > # A function to invert a matrix using...
2009 Jun 17
3
Matrix inversion-different answers from LAPACK and LINPACK
Hello. I am trying to invert a matrix, and I am finding that I can get different answers depending on whether I set LAPACK true or false using "qr". I had understood that LAPACK is, in general more robust and faster than LINPACK, so I am confused as to why I am getting what seems to be invalid answers. The matrix is ostensibly the Hessian for a function I am optimizing. I want to get