Displaying 2 results from an estimated 2 matches for "bmatrix".
Did you mean:
matrix
2001 Nov 05
1
Why doesn't outer work?
...The R-code is given below, the first part sets various
parameters, then there are several functions. The main functions are called
bigmatrix and new.bigmatrix which construct the matrices, these should give
the same answers, as all I've done is replace the nested loops with outer
functions. The Bmatrix calculation is correct but the Pmatrix calculation
gets some of the answers wrong. The final lines of code test the functions.
Any advice on what's going wrong would be greatly appreciated, also any tips
for speeding up the code would fantastic.
Many thanks
Mark
Dr Mark Rees
Imperial Colleg...
2012 Mar 11
2
Efficient access to elements of a list of lists
Hi,
I have a long list of lists from which I want to efficiently extract
and rbind elements. So I'm using the approach below:
f <- function(i){
out <- replicate(5, list(matrix(rnorm(80), nc=20)))
names(out) <- letters[1:5]
out
}
set.seed(1)
lst <- lapply(1:1.5e6, f)
(t0 <- system.time(tmp <- do.call(rbind, lapply(lst, '[[', 'b'))))
Is there