[R] Matrix operations
Bill.Venables at csiro.au
Bill.Venables at csiro.au
Tue Jun 29 05:05:21 CEST 2010
Since X is a vector, then
A <- sum(X, solve(V, X))
is probably slightly better here.
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Dmitrij Kudriavcev
Sent: Tuesday, 29 June 2010 12:29 PM
To: r-help at r-project.org
Subject: [R] Matrix operations
Hello
I have a quick question.
I need to compute matrix in R, like A <- t(X) %*% solve(V) %*% X, where X is
a vector and V is a matrix
This code works, but now i want to optimize it. I have try:
A <- crossprod(X, solve(V)) %*% X
Is there another, better way?
WBR
Dima
[[alternative HTML version deleted]]
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list