Displaying 20 results from an estimated 43559 matches for "solve".
2000 Apr 28
3
Matrix inverse
I haven't found a function that directly calculates the matrix inverse, does it exist? Otherwise what would be the fastest way to do it?
Patrik Waldmann
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the
2000 May 01
1
solve vs. qr.solve
> Date: Mon, 1 May 2000 16:25:11 +0200 (CEST)
> From: gb <gb at stat.umu.se>
>
> On 1 May 2000, Douglas Bates wrote:
> > gb <gb at stat.umu.se> writes:
> >
> > > How about 'Ainv <- qr.solve(A)'?
> > >
> > > I happened to read the help page for 'qr.solve' the other day, and there I
> > > found that qr.solve(A, b) "is == but much better than solve(A) %*% b".
> > > (I guess that 'better than' refers to numerical stability...
2010 Jun 12
1
sharing experience - installing R Spatial Views
Hi Guys,
I would like to share my experience when installing the Spatial views
packages for R. I could not install 32 packages which are parts of the
Spatial views, and I use google-search and search to solve ALL those
problems for about 2 days. I hope maybe somebody would benefit from my
experience.
I admitted that I do not have excellent programming skills at all. So,
perhaps some of steps I did are not necessary to solve the problem at
hands. But it works and I am happy.
I was lucky if the prob...
2009 Oct 14
1
using mapply to avoid loops
...s fine), and the second set of code attempts to use mapply but I get a "subscript out of bounds" error. Any guidance would be greatly appreciated. Xj, Yj, and Wj are also lists, and s2, TAU, and GAMMA are scalars.
Thank You.
# THIS WORKS USING THE LOOP
for (j in 1:J) {
V.tilde.j <- solve((1/s2)*t(Xj[[j]])%*%Xj[[j]] + solve(TAU))
# Not singular case:
if(round(det(t(Xj[[j]])%*%Xj[[j]]),8)!=0) {
Beta.hat.j <- solve(t(Xj[[j]])%*%Xj[[j]])%*%t(Xj[[j]])%*%Yj[[j]]
V.j <- s2*solve(t(Xj[[j]])%*%Xj[[j]])
Lambda.j <- solve(solve(V.j) + solve(TAU))%*%solve(V.j)
Beta.tilde.j <- L...
2003 Oct 30
3
Change in 'solve' for r-patched
The solve function in r-patched has been changed so that it applies a
tolerance when using Lapack routines to calculate the inverse of a
matrix or to solve a system of linear equations. A tolerance has
always been used with the Linpack routines but not with the Lapack
routines in versions 1.7.x and 1.8.0....
2010 Sep 01
2
What solve() does?
Hello!
Can anyone explain me what solve() function does: Gaussian elimination
or iterative, numeric solve? In addition, I would need both the Gaussian
elimination and iterative solution for the course. Are the two built in R?
Thanks!
PM
2016 Apr 20
6
Solving sparse, singular systems of equations
I have a situation in R where I would like to find any x (if one exists) that solves the linear system of equations Ax = b, where A is square, sparse, and singular, and b is a vector. Here is some code that mimics my issue with a relatively simple A and b, along with three other methods of solving this system that I found online, two of which give me an error and one of which succ...
2012 Dec 11
2
Catching errors from solve() with near-singular matrices
Dear all,
The background is that I'm trying to fix this bug in the geometry
package:
https://r-forge.r-project.org/tracker/index.php?func=detail&aid=1993&group_id=1149&atid=4552
Boiled down, the problem is that there exists at least one matrix X for
which det(X) != 0 and for which solve(X) fails giving the error "system
is computationally singular: reciprocal condition number = ..." (see
appended code & attached file). I don't want my function that calls
solve(X) to return an error.
I can think of two strategies for dealing with this problem:
Strategy 1: Some c...
2007 Dec 22
1
using solve.qp without a quadratic term
I was playing around with a simple example using solve.qp ( function is in the quadprog package ) and the code is below. ( I'm not even sure there if there is a reasonable solution because I made the problem up ).
But, when I try to use solve.QP to solve it, I get the error that D in the quadratic function is not positive
definite. This is becau...
2009 Jun 17
1
Inverting a square matrix using solve() with LAPACK=TRUE (PR#13762)
Full_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 i...
2009 May 15
1
Matrix package,solve() errors and crashes Please help
...//dropbox.unl.edu/uploads/20090522/7a0d0313f21fd6a8/Bonacich%20Power.RData
>
Graph size
*Vertices: 20924
Edges: 146938
Directed: FALSE
No graph attributes.
Vertex attributes: name.
No edge attributes.
*
computer Configuration
*WIndows XP service Pack 3 .0 GB RAM*
I am using SPARSE matrix to solve the problem
This is the code I use to obtain bonpower using Sparse Matrix &
alternatively the code is in the following website
http://igraph.wikidot.com/r-recipes#toc6
*bonpow.sparse <- function(graph, nodes=V(graph), loops=FALSE,
exponent=1, rescale=TRUE, tol=1e-...
2010 Jan 05
4
solving cubic/quartic equations non-iteratively
To R-helpers,
R offers the polyroot function for solving mentioned equations
iteratively.
However, Dr Math and Mathworld (and other places) show in detail how to
solve mentioned equations non-iteratively.
Do implementations for R that are non-iterative and that solve mentioned
equations exists?
Regards, Mads Jeppe
2016 Apr 20
0
Solving sparse, singular systems of equations
...u really want to proceed. See also ?svd and package irlba.
--
Sent from my phone. Please excuse my brevity.
On April 20, 2016 4:22:34 AM PDT, A A via R-help <r-help at r-project.org> wrote:
>
>
>
>I have a situation in R where I would like to find any x (if one
>exists) that solves the linear system of equations Ax = b, where A is
>square, sparse, and singular, and b is a vector. Here is some code that
>mimics my issue with a relatively simple A and b, along with three
>other methods of solving this system that I found online, two of which
>give me an error and o...
2016 Apr 20
0
Solving sparse, singular systems of equations
> On 20 Apr 2016, at 13:22, A A via R-help <r-help at r-project.org> wrote:
>
>
>
>
> I have a situation in R where I would like to find any x (if one exists) that solves the linear system of equations Ax = b, where A is square, sparse, and singular, and b is a vector. Here is some code that mimics my issue with a relatively simple A and b, along with three other methods of solving this system that I found online, two of which give me an error and one of which succ...
2016 Apr 20
0
Solving sparse, singular systems of equations
...matrix into a dense one before doing
any linear algebra).
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Apr 20, 2016 at 4:22 AM, A A via R-help <r-help at r-project.org>
wrote:
>
>
>
> I have a situation in R where I would like to find any x (if one exists)
> that solves the linear system of equations Ax = b, where A is square,
> sparse, and singular, and b is a vector. Here is some code that mimics my
> issue with a relatively simple A and b, along with three other methods of
> solving this system that I found online, two of which give me an error and
&g...
2004 Feb 16
4
Matrix mulitplication
ABCD are four matrix.
A * Inverse((Transpose(A)*Tranpose(B)*B*A+C)) * Transpose(A) * Transpose(B) * D
how to write in R in an efficient way?
---------------------------------
[[alternative HTML version deleted]]
2003 Aug 07
3
ginv vs. solve
Why do
x<-b%*%ginv(A)
and
x<-solve(A,b)
give different results?. It seems that I am missing some basic feature of
matrix indexing.
e.g.:
A<-matrix(c(0,-4,4,0),nrow=2,ncol=2)
b<-c(-16,0)
x<-b%*%ginv(A);x
x<-solve(A,b);x
Thanks in advance,
Angel
2002 Sep 26
3
error with complex solve (PR#2068)
Full_Name: John Peters
Version: 1.5.1
OS: Windows 2000
Submission from: (NULL) (130.155.2.3)
solve(a,b) with two arguments gives an error if a is complex and b is a vector:
> a_matrix(c(1,2+3i,3,2),ncol=2)
> a
[,1] [,2]
[1,] 1+0i 3+0i
[2,] 2+3i 2+0i
> b_c(2,2+1i)
> solve(a,b)
Error in solve.default(a, b) : A must be a complex matrix
> is.complex(a)
[1] TRUE
> is.matri...
2005 Feb 02
0
Not reproducing GLS estimates
...("score.1"),direction='long')
long$time<-long$time-1
Now I run this through a gls as follows:
fm1 <- gls(score.1~I(time), data=long,
correlation=corAR1(form=~1|ID), method='ML')
Now, I am trying to replicate the gls using matrix techniques. Here is
my code for to solve (X' V^{-1} X) ^{-1} X' V^{-1} y for the point
estimates and (X' V^{-1} X) ^{-1} for the standard errors.
score<-long$score
X.mat<-model.matrix(score~time, long, row.names=F)
var.mat<-getVarCov(fm1)
I<-diag(sample.size)
V <- kronecker(I,var.mat)
pe<-solve(crossprod(X.m...
2007 Nov 26
3
Fwd: Empty list to use in a for cycle
? stato filtrato un testo allegato il cui set di caratteri non era
indicato...
Nome: non disponibile
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20071126/35b0349a/attachment.pl