Displaying 20 results from an estimated 11000 matches similar to: "Matrix mulitplication"
2008 Apr 15
2
Transposing Data Frame does not return numeric entries
x <- read.table("LittleGarvin.csv", sep=",", header=TRUE)
y <- t(x)
str(y)
chr [1:193, 1:288] "oligocha" "0" " 0" " 0" " 0" "0" ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:193] "X" "upwd1201" "upwd0502" "upwd0702" ...
  ..$ : NULL
x is a data frame with
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
2004 Oct 06
3
crossprod vs %*% timing
Hi
the manpage says that crossprod(x,y) is formally equivalent to, but
faster than, the call 't(x) %*% y'.
I have a vector 'a' and a matrix 'A', and need to evaluate 't(a) %*% A
%*% a' many many times, and performance is becoming crucial.  With
f1 <- function(a,X){ ignore <- t(a) %*% X %*% a               }
f2 <- function(a,X){ ignore <-
2009 Oct 02
1
How to select a subset <number of dimensions matter>
Hi guys,
I need your help.
I would like to select a subset from a dataset.
This is the dimension of the dataset.
> dim(data1)
[1]   72   36 1916
so, it's like.. there are 1916 of  72 * 36 matrix. ==> looks like 72 * (
36*1916 )
**
*1)*
And I would like to select the first 72*36 matrix. This is how I did:
> two=data1[,1:36]
Error in data1[, 1:36] : incorrect number of dimensions
2004 May 10
5
R versus SAS: lm performance
Hello,
A collegue of mine has compared the runtime of a linear model + anova in SAS and S+. He got the same results, but SAS took a bit more than a minute whereas S+ took 17 minutes. I've tried it in R (1.9.0) and it took 15 min. Neither machine run out of memory, and I assume that all machines have similar hardware, but the S+ and SAS machines are on windows whereas the R machine is Redhat
2010 Jul 30
4
transpose of complex matrices in R
Hello everybody
When one is working with complex matrices, "transpose"  very nearly 
always means
*Hermitian* transpose, that is, A[i,j] <- Conj(A[j,i]).
One often writes A^* for the Hermitian transpose.
I have only once seen a  "real-life" case
where transposition does not occur simultaneously with complex conjugation.
And I'm not 100% sure that that wasn't a
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.  (You can use the optional
argument tol = 0 to override this check for computational
2000 Jul 11
1
MANOVA
Hi
I need to compare the performance of two sludge inertization methods. For that i want make a manova Wilks test. 
Description of the experiment:
After the calcination at different temperatures my calcinated sludge are submeted to the lixiviation test. In my tables i show the concentration of the some elements in the extract phase. 
The results:
Method A (calcination at 1100 C)
Chromium
2010 Oct 29
2
Differenciate numbers from reference for rows
So, I am having a tricky reference file to extract information from.
The format of the file is
x   1 + 4 * 3 + 5 + 6 + 11 * 0.5
So, the elements that are not being multiplied (1, 5 and 6) and the elements
before the multiplication sign (4 and 11) means actually the reference for
the row in a matrix where I need to extract the element from.
The numbers after the multiplication sign are regular
2006 Mar 13
1
anova.mlm (single-model case) does not handle factors? (PR#8679)
Full_Name: Yves Rosseel
Version: 2.2.1
OS: i686-pc-linux-gnu
Submission from: (NULL) (157.193.116.152)
Dear developers,
For the single-model case, the anova.mlm() function does not seem to handle
multi-parameter predictors (eg factors) correctly. A toy example illustrates the
problem:
Y <- cbind(rnorm(100),rnorm(100),rnorm(100))
A <- factor(rep(c(1,2,3,4), each=25))
fit <- lm(Y ~ A)
2006 Aug 16
3
separate row averages for different parts of an array
I have an array with 44800 columns and 24 rows I would like to compute the
row average for the array 100 columns at a time, so I would like to end up
with an array of 24 rows x 448 columns. I have tried using apply(dataset, 1,
function(x) mean(x[])), but I am not sure how to get it to take the average
100 columns at a time. Any ideas would be  welcomed.
thanks,
Spencer
	[[alternative HTML
2005 Jan 27
3
the incredible lightness of crossprod
The following is at least as much out of intellectual curiosity
as for practical reasons. 
On reviewing some code written by novices to R, I came
across:
crossprod(x, y)[1,1]
I  thought, "That isn't a very S way of saying that,  I wonder
what the penalty is for using 'crossprod'."  To my surprise the
penalty was substantially negative.  Handily the client had S-PLUS
as
2002 Jul 14
1
crossprod and X %*% t(X)
hi,
the help page for crossprod states that crossprod(A,B) is faster than
t(A) %*% B; experimentation certainly bears this out. more alarming
is the evidence that crossprod(t(A), B) is faster than A %*% B:
on a PII laptop, 128MB memory, win98, R-1.5.0.-patched precompiled
(no ATLAS):
> A <- matrix(rnorm(250000),500,500)
> B <- matrix(rnorm(250000),500,500)
> for (i in 1:5) {
2002 Aug 09
2
Help with improving efficiency
Dear All,
I have a problem that I think could be solved much more efficiently, but
I don't have a clue how to accomplish this. I have a matrix W with
dimensions k*(p+1):
Let's say W is 5*4 and looks like this:
> W
      [,1] [,2] [,3] [,4]
 [1,]    1   -1   -1    1
 [2,]    1    1    1    1
 [3,]    1    2   -2   -1
 [4,]    1    0   -1   -1
 [5,]    1   -2   -1    0
I want to take
2002 Jun 12
3
How does R compares for speed?
Hi,
For those who are interested, I have update my R benchmark (to version
1.5.0) and also to Splus 6. They are available at:
http://www.sciviews.org/other/benchmark.htm. A comparison is made between
Matlab (5.3 & 6), R 1.5.0, Splus 6 rel 2, O-Matrix 5.1, Octave 2.1.31,
Scilab 2.6, Rlab 2.1 and OX 3.00 under Windows 2000 pro.
Overall, R is not the fastest package, but it is one of the
2008 Dec 23
1
aggregate / tranpose data
Dear R-Users,
Suppose I have data in the following format:
CODE_NAME     ZIP_CODE
John                   12345
John                   23456
John                   34567
Jane                   13242
Jane                   22123
I want to transpose / convert it into:
CODE_NAME     ZIP_CODE
John                  12345,23456,34567
Jane                  13242,22123
Any idea/pointer is appreciated.
2003 Nov 25
1
64-bit R on Opteron [was Re: Windows R 1.8.0 hangs when M em Usage >1.8GB]
> From: Douglas Bates [mailto:bates at bates4.stat.wisc.edu]
> 
> "Liaw, Andy" <andy_liaw at merck.com> writes:
> 
> > Sorry.  I need to retract my claim.  There seems to be a 3G 
> limit, even
> > though the OS could handle nearly 8G.  (I can have two 
> simultaneous R
> > processes each using near 3G.)
> > 
> > On another note, on
2003 Nov 25
1
64-bit R on Opteron [was Re: Windows R 1.8.0 hangs when M em Usage >1.8GB]
> From: Douglas Bates [mailto:bates at bates4.stat.wisc.edu]
> 
> "Liaw, Andy" <andy_liaw at merck.com> writes:
> 
> > Sorry.  I need to retract my claim.  There seems to be a 3G 
> limit, even
> > though the OS could handle nearly 8G.  (I can have two 
> simultaneous R
> > processes each using near 3G.)
> > 
> > On another note, on
2006 Mar 05
6
Polycom 501 power over ethernet
When I bought two Polycom 501 SIP phones, I naively thought they were  
Power-over-Ethernet (IEEE 802.3af) because they were "powered over  
ethernet."  Silly me.
Polycom must have some odd voltage or funny way of injecting the  
power, because the POE switch I bought for them (Netgear F@510P)  
won't power them, though if I use the Polycom-supplied AC adapter and  
ethernet power
2010 Dec 20
1
transposing panel data
I am currently trying to transpose some large panel data set ie transposing multiple rows in into a single column. instead the transpose functionality transposes all rows into columns. my sample data set looks like below:
 
 
 
 
 
 
  ACCT_NUM
  ACCOUNT_NAME
  TRAN_AMT
  DATE
  EMPLOYER
 
 
  101913
  GK
  7489
  30-Apr-10
  PENSION
 
 
  101913
  GK
  7489
  30-May-10
  PENSION
 
 
  101913