Displaying 20 results from an estimated 28432 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

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

2009 May 15

1

Matrix package,solve() errors and crashes Please help

...u/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=T...

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

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

2003 Jun 02

1

Help with factorized argument in solve.QP

Hi
I'm having problems getting the "factorized" argument in solve.QP (part
of the quadprog library) to work as expected. The helpfile states that
when the factorized argument is set to TRUE, then the function requires
the inverse of a square-root factor of the Hessian instead of the
Hessian itself. That is, when factorized=TRUE, the Dmat argument should
be a matr...

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

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

2005 Oct 05

2

eliminate t() and %*% using crossprod() and solve(A,b)

Hi
I have a square matrix Ainv of size N-by-N where N ~ 1000
I have a rectangular matrix H of size N by n where n ~ 4.
I have a vector d of length N.
I need X = solve(t(H) %*% Ainv %*% H) %*% t(H) %*% Ainv %*% d
and
H %*% X.
It is possible to rewrite X in the recommended crossprod way:
X <- solve(quad.form(Ainv, H), crossprod(crossprod(Ainv, H), d))
where quad.form() is a little function that evaluates a quadratic form:
quad.form <- function (M, x...

2016 Apr 20

1

Solving sparse, singular systems of equations

...ed file).
On Wednesday, April 20, 2016 2:01 PM, Berend Hasselman <bhh at xs4all.nl> wrote:
> 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...

2006 Nov 07

4

solve computationally singular

Hi uRsers,
when inverting a 2 by 2 matrix using solve, I encountered a error message:
solve.default(sigma, tol = 1e-07) :
system is computationally singular: reciprocal condition number
= 1.7671e-017
and then I test the determinant of this matrix: 6.341393e-06.
In my program, I have a condition block that whether a matrix is
invertible lik...

2009 Feb 16

2

solve.QP with box and equality constraints

Dear list,
I am trying to follow an example that estimates a 2x2 markov transition
matrix across several periods from aggregate data using restricted least
squares.
I seem to be making headway using solve.QP(quadprog) as the unrestricted
solution matches the example I am following, and I can specify simple
equality and inequality constraints. However, I cannot correctly specify a
constraint matrix (Amat) with box constraints per cell and equality
constraints that span multiple cells. Namely the solu...

2015 Jan 12

3

[LLVMdev] NP-hard problems in the LLVM optimizer?

Hi all.
I’ve heard a couple of times that some of the problems solved by various
passes in the optimizer are indeed NP-hard, even though the instances
are small enough to be tractable (and very quickly).
Is this true? If so, which are these problems?
Register allocation? Instruction scheduling?
Are they solved exactly or by approximations?
Or not solved at all (...

2005 Jan 03

9

Just saw your [Asterisk] xJack Segfault in Asterisk

Hi:
Just saw your post while trying to solve a similar asterisk problem. Did
not see any responses. Was your problem solved and what was the solution?
Carey

2012 Oct 19

2

Which package/function for solving weighted linear least squares with inequality and equality constraints?

Dear All,
Which package/function could i use to solve following linear least square
problem?
A over determined system of linear equations is given. The nnls-function may
would be a possibility BUT:
The solving is constrained with
a inequality that all unknowns are >= 0
and a equality that the sum of all unknowns is 1
The influence of the equatio...

2018 Feb 15

0

Help with factorized argument in solve.QP

Hello David,
same problem here with solve.QP.
dykstra is causing problems as well and giving for the value NA if
factorized = TRUE:
library(quadprog)
library(Dykstra)
R<-cbind(c(1,1),c(0,1));
d<-c(t(R)%*%R%*%c(2,1))
solve.QP(solve(R),d,-as.matrix(c(1,1)),-2,1,factorized = TRUE)
S<-t(R)%*%R;
solve.QP(S,d,-as.matrix(c(1,...

2001 Oct 18

1

AW: General Matrix Inverse

...**************************
*****
> -----Urspr?ngliche Nachricht-----
> Von: Torsten Hothorn
> Gesendet am: Thursday, October 18, 2001 9:52 AM
> An: Philippe Grosjean
> Cc: r-help at stat.math.ethz.ch
> Betreff: RE: [R] General Matrix Inverse
>
>
>
> > I use solve(x) to find the inverse of a matrix (don't know what a
> "general
> > inverse" is). By the way, what is better: solve(x), qr.solve(x) or
> ginv(x)?
> > ginv(x) seems to give results for matrices where solve and qr.solve
> return
> > an error:
> >
>...

2011 Mar 16

2

Singularity problem

Dear R,
If I have remembered correctly, a square matrix is singular if and only if
its determinant is zero. I am a bit confused by the following code error.
Can someone give me a hint?
> a <- matrix(c(1e20,1e2,1e3,1e3),2)
> det(a)
[1] 1e+23
> solve(a)
Error in solve.default(a) :
system is computationally singular: reciprocal condition number = 1e-17
Thanks in advance!
Feng
--
Feng Li
Department of Statistics
Stockholm University
106 91 Stockholm, Sweden
http://feng.li/
[[alternative HTML version deleted]]

2009 Jul 14

1

LAPACK package

Hi All,
Can someone tell me if solve function shown below for my version of R is
proper or not?
I am using R 2.7.2 .Wherever i have used this function ,i got results which
were different from the expected results as computed using SPSS.
Description of this function says:--
Solve a System of EquationsDescription
This generic functi...