Re: [R] Block-diagonal matrix

2005-09-01 Thread Robin Hankin
Hi adiag() from the magic package does what you want: library(magic) Loading required package: abind a - matrix(1,2,2) b - matrix(6,2,3) adiag(a,b) [,1] [,2] [,3] [,4] [,5] [1,]11000 [2,]11000 [3,]00666 [4,]006

[R] Block-Diagonal Matrix and Multivariate Skew Normal

2005-08-31 Thread Caio Lucidius Naberezny Azevedo
Dear R-users, Does anybody know how to construct a block-diagonal matrix (with the blocks being different matrixs, concerning the dimension and the values) ? I would like to know also if there is any package that generates values from a multivariate skew normal distribution. Thanks all,

Re: [R] Block-Diagonal Matrix and Multivariate Skew Normal

2005-08-31 Thread Liaw, Andy
For your first question, here's a function originally posted by Ben Bolker, with modification by Rich Raubertas: blockdiag - function (x, ...) { if (!is.list(x)) x - list(x) args - list(...) if (length(args) 0) args - c(x, args) else args - x idx -

[R] Block-diagonal matrix

2005-08-31 Thread Caio Lucidius Naberezny Azevedo
Dear R-users, Does anybody know how to construct a block-diagonal matrix (with the blocks being different matrixs, concerning the dimension and the values), without use loops ? Thanks all, Caio - [[alternative HTML version

[R] block diagonal matrix function

2004-05-27 Thread Robin Hankin
Hello List I have just written a little function that takes two matrices as arguments and returns a large matrix that is composed of the two input matrices in upper-left position and lower-right position with a padding value everywhere else. (function definition and toy example below). I need

Re: [R] block diagonal matrix function

2004-05-27 Thread Dimitris Rizopoulos
: Robin Hankin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 27, 2004 10:24 AM Subject: [R] block diagonal matrix function Hello List I have just written a little function that takes two matrices as arguments and returns a large matrix that is composed of the two input matrices