At 16:29 30/07/2007, Gregory Gentlemen wrote:
Douglas Bates [EMAIL PROTECTED] wrote: On 7/27/07, Gregory
Gentlemen wrote:
Greetings,
I have a seemingly simple task which I have not been able to
solve today. I want to construct a symmetric matrix of arbtriray
size w/o using loops. The
Greetings,
I have a seemingly simple task which I have not been able to solve today. I
want to construct a symmetric matrix of arbtriray size w/o using loops. The
following I thought would do it:
p - 6
Rmat - diag(p)
dat.cor - rnorm(p*(p-1)/2)
Rmat[outer(1:p, 1:p, )] - Rmat[outer(1:p, 1:p, )]
after dat.cor use:
Rmat[lower.tri(Rmat)] - dat.cor
Rmat - t(Rmat)
Rmat[lower.tri(Rmat)] - dat.cor
b
On Jul 27, 2007, at 11:28 PM, Gregory Gentlemen wrote:
Greetings,
I have a seemingly simple task which I have not been able to solve
today. I want to construct a symmetric matrix of
On 7/27/07, Gregory Gentlemen [EMAIL PROTECTED] wrote:
Greetings,
I have a seemingly simple task which I have not been able to solve today. I
want to construct a symmetric matrix of arbtriray size w/o using loops. The
following I thought would do it:
p - 6
Rmat - diag(p)
dat.cor -
Since a symmetric matrix must be square, the following code does it:
X-5
MAT-matrix(rnorm(X*X),X,X)
MAT-MAT+t(MAT)
MAT
[,1] [,2] [,3] [,4] [,5]
[1,] 0.1084372 -1.7867366 -0.9620313 -1.0925719 -0.5902326
[2,] -1.7867366 -0.0462097 -1.2707656 0.6112664
Douglas Bates [EMAIL PROTECTED] wrote: On 7/27/07, Gregory Gentlemen wrote:
Greetings,
I have a seemingly simple task which I have not been able to solve today. I
want to construct a symmetric matrix of arbtriray size w/o using loops. The
following I thought would do it:
p - 6
Rmat -
On Fri, 27 Jul 2007, Gregory Gentlemen wrote:
Greetings,
I have a seemingly simple task which I have not been able to solve
today. I want to construct a symmetric matrix of arbtriray size w/o
using loops. The following I thought would do it:
p - 6
Rmat - diag(p)
dat.cor -
On 7/30/07, Gregory Gentlemen [EMAIL PROTECTED] wrote:
Douglas Bates [EMAIL PROTECTED] wrote:
On 7/27/07, Gregory Gentlemen wrote:
Greetings,
I have a seemingly simple task which I have not been able to solve today.
I want to construct a symmetric matrix of arbtriray size w/o using
it.
Bert Gunter
Genentech Nonclinical Statistics
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gregory Gentlemen
Sent: Friday, July 27, 2007 8:28 PM
To: r-help@stat.math.ethz.ch
Subject: [R] generating symmetric matrices
Greetings,
I have a seemingly simple
hello
try
?upper.tri
# example
p - 6
Rmat - diag(p)
dat.cor - rnorm(p*(p-1)/2)
Rmat[upper.tri(Rmat)]- dat.cor
Rmat[lower.tri(Rmat)]- dat.cor
Cleber Borges
Greetings,
I have a seemingly simple task which I have not been able to solve today. I
want to construct a
On 28-Jul-07 03:28:25, Gregory Gentlemen wrote:
Greetings,
I have a seemingly simple task which I have not been able to solve
today. I want to construct a symmetric matrix of arbtriray size w/o
using loops. The following I thought would do it:
p - 6
Rmat - diag(p)
dat.cor -
Gregory Gentlemen gregory_gentlemen at yahoo.ca writes:
Greetings,
I have a seemingly simple task which I have not been able to solve today. I
want to construct a symmetric
matrix of arbtriray size w/o using loops. The following I thought would do it:
[snip]
p - 6
Rmat - diag(p)
vals
12 matches
Mail list logo