Displaying 10 results from an estimated 10 matches for "innefici".
2005 Jun 16
5
Vectorization
Greetings,
Can anyone suggest me if we can vectorize the following problem
effectively?
I have two datasets, one dataset is portfolio of stocks returns on a
historical basis and another dataset consist of a bunch of factors (again on
a historical basis). I intend to compute a rolling n-day sensitivitiesfor
each stock for each factor, so the output will be a data frame with
2006 Feb 23
2
lighttpd and blank page
...os x with RoR. It normally works great,
however, when I use it for one project, kill the process, then switch
to another project and start up using ./script/server, all I get is a
blank page. No errors or html. The only solution I have found so far
is to restart my machine, but that seems terribly inneficient. How
does everybody else handle this, or do you guys not have this problem?
Thanks!
--
Randy Schmidt
x@altorg.com
267.334.6833
2007 Jan 23
3
[fixed] vectorized nested loop: apply a function that takes two rows
...gument mismatch. Two vectors needed as input.")}
}
# The loop-based solution I have is:
if (is(x, "Matrix") ) {
cos = array(NA, c(ncol(x), ncol(x)))
for (i in 2:ncol(x)) {
for (j in 1:(i - 1)) {
cos[i, j] = cosine(x[, i], x[, j])
}
}
}
This solution seems inneficient. Is there an easy way of achieving this with a
clever do.call + apply combination?
Also, I have noticed that getting a row from a Matrix object produces a normal
array (i.e., it does not inherit Matrix class). However, selecting >1 rows, does
produce a same-class matrix. If I convert with as...
2007 Jan 23
3
[fixed] vectorized nested loop: apply a function that takes two rows
...gument mismatch. Two vectors needed as input.")}
}
# The loop-based solution I have is:
if (is(x, "Matrix") ) {
cos = array(NA, c(ncol(x), ncol(x)))
for (i in 2:ncol(x)) {
for (j in 1:(i - 1)) {
cos[i, j] = cosine(x[, i], x[, j])
}
}
}
This solution seems inneficient. Is there an easy way of achieving this with a
clever do.call + apply combination?
Also, I have noticed that getting a row from a Matrix object produces a normal
array (i.e., it does not inherit Matrix class). However, selecting >1 rows, does
produce a same-class matrix. If I convert with as...
2009 Feb 10
1
Calculating variables
...ombine the whole 5 variables changing at
once. I understand there are many possible combinations (factorial of
5000!, 422 with some 500 digits) but I surmise there must be a better
way to do it.
So far, I have been changing them manually, but this task make the
whole thing terribly slow and inneficient.
Any ideas are appreciated.
Thanks.
Cuanto mas grande son, mas daño hacen. Postulado de Perkin.
------------------------------
Jesús Guillermo Andrade (Abg.)
Gerente de Litigios y Corporativo. EDM. AC. API.
Andrade & Moreno S.C. (http://amlegal.wordpress.com/)
[[alternative HTML version...
2005 Nov 19
5
help with apply, please
...s.
I solved this problem by creating a second logical matrix which contains all
possible combinations of rows:
tt <- matrix(as.logical(c(1,0,0,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,1,1,1)), nrow=3)
and then subset the first matrix and check if all columns are covered.
This solution, though, is highly inneficient and I am certain that a
combination of apply or something will do.
###########################
possibles <- NULL
length.possibles <- NULL
## I guess the minimum solution is has half the number of rows
guesstimate <- floor(nrow(tt)/2) + nrow(tt) %% 2
checked <- logical(nrow(tt))
re...
2007 Jan 23
0
vectorized nested loop: apply a function that takes two rows
...vectors needed as input.")}
}
# The loop-based solution I have is:
if (is(x, "Matrix") ) {
cos = array(NA, c(ncol(x), ncol(x))) # preallocate memory
for (i in 2:ncol(x)) {
for (j in 1:(i - 1)) {
cos[i, j] = cosine(x[, i], x[, j])
}
}
}
This solution seems inneficient. Is there an easy way of achieving this with a
clever do.call + apply combination?
--
Thanks in advance,
-Jose
--
Jose Quesada, PhD
Research fellow, Psychology Dept.
Sussex University, Brighton, UK
http://www.andrew.cmu.edu/~jquesada
2004 Oct 16
7
sapply and loop
Dear all,
I am doing 200 times simulation. For each time, I generate a matrix and
define some function on this matrix to get a 6 dimension vector as my
results.
As the loop should be slow, I generate 200 matrice first, and save them into
a list named ma,
then I define zz<-sapply(ma, myfunction)
To my surprise, It almost costs me the same time to get my results if I
directly use a loop
2004 Oct 16
7
sapply and loop
Dear all,
I am doing 200 times simulation. For each time, I generate a matrix and
define some function on this matrix to get a 6 dimension vector as my
results.
As the loop should be slow, I generate 200 matrice first, and save them into
a list named ma,
then I define zz<-sapply(ma, myfunction)
To my surprise, It almost costs me the same time to get my results if I
directly use a loop
2008 Jun 18
3
Website callback
Hi,
I have a website where customers enter their phone numbers to be called. I'd
like them to have to put in information and 'schedule' a call.
1) Call Immediately
2) Call in the next _ minutes
3) Call me tomorrow, same time.
So, Asterisk will pull two variables from this php websites, $phonenumber
and $timetocall. $timetocall will need to be calculated as