Displaying 3 results from an estimated 3 matches for "matrix_2".
Did you mean:
matrix2
2010 Apr 22
6
macro variable in R?
I need to create 10 matrices. say matrix 1-10.
matrix_1 is 1 by 1
matrix_2 is 2 by 2
matrix_3 is 3 by 3
.
.
.
matrix_10 is 10 by 10
I am just wondering if there are some functions in R that are similar to the
macro variables in SAS. so I can create these 10 matrices by doing:
for (i in 1: 10) {
matrix_$i <- matrix(nrow=i, ncol=i)
}
rather thank creating thes...
2009 Aug 10
0
Speeding up a bootstrap routine
...y_return2;
zerocentredreturns3 <- actualreturns1-average_daily_return3;
n <- length(detrendedreturns);
result1 <- 0.0; # initialise result
result2 <- 0.0; # initialise result
result3 <- 0.0; # initialise result
# create matrices to hold sampling returns
matrix_1 <- matrix(0,1,n)
matrix_2 <- matrix(0,1,n)
matrix_3 <- matrix(0,1,n)
datevector <- 1:n # create vector for the actual "date sampling"
# the bootstrap routine, placing results into the above results matrices
for(i in 1:5000) {
date_sample <- datevector[sample(n,n,replace=TRUE)]
for(j in 1:n) {
ma...
2009 Sep 21
2
Combine vectors in order to form matrixes with combn
Hello!
I've a problem with the combn function and a set of vector. I
would like to make a simple combination where, instead of scalars, i
would like to combine vector, in order to form matrixes.
In other
words, i have nineteen 6-items vectors (for example coef1-coef19), that
i would like to combine in n!/k!(n-k)! 6x6 matrixes.
I tried with a
code like this
mma <-