Displaying 20 results from an estimated 400 matches similar to: "parallel computing with 'foreach'"
2010 Nov 10
2
Parallel code runs slower!
My parallel code is running slower than my non-parallel code! Can someone
pls advise what am I doing wrong here?
t and tTA are simple matrices of equal dimensions.
#NON PARALLEL CODE
nCols=ncol(t)
nRows=nrow(t)
tTA = matrix(nrow=nRows,ncol=nCols)
require(TTR)
system.time(
for (i in 1:nCols) {
x = t[,i]
xROC = ROC(x)
tTA[,i]=xROC
}
)
user system elapsed
123.24 0.07 123.47
#
2011 May 27
0
saving multiple arrays from a foreach loop
Dear R-List member,
I have a problem when I'm trying to save two arrays from a foreach-loop.
I'm also not sure whether this is possible or just my inexperience.
However, this works perferctly fine with a for-loop.
Here is an example code - any help is much appreciated!!:
############
n.vpn = 2
n.run= 3
# create to empty matrices
sme = matrix(NA,4,n.vpn)
test = matrix(NA,4,n.vpn)
#
2011 Apr 19
0
doSMP package works better than perfect, at least sometimes.
Some might have noticed that REvolution Computing released the doSMP
package to the general public about a month and a half ago, which allows
multiple cores to be accessed for parallel computation in R. Some of our
physical habitat calculations were taking an extraordinary amount of time
to complete and required over-weekend runs, which prompted our interest in
this package. What follows
2010 Aug 11
4
Arbitrary number of covariates in a formula
Hello!
I have something like this:
test1 <- data.frame(intx=c(4,3,1,1,2,2,3),
status=c(1,1,1,0,1,1,0),
x1=c(0,2,1,1,1,0,0),
x2=c(1,1,0,0,2,2,0),
sex=c(0,0,0,0,1,1,1))
and I can easily fit a cox model:
library(survival)
coxph(Surv(intx,status) ~ x1 + x2 + strata(sex),test1)
However, I want to
2018 Mar 02
1
Variable centring within "predict.coxph"
Dear R-help,
I am using R-3.3.2 on Windows 10. I teach on a course which has 4 computer practical sessions related to the development and validation of clinical prediction models. These are currently written for Stata and I am in the process of writing them for use in R too (as I far prefer R to Stata!)
I notice that predictions made from a Cox model in Stata are based on un-centred variables,
2010 Jun 16
2
Parallel computing on Windows (foreach) (Sergey Goriatchev)
foreach (or virtually anything you might use for concurrent programming)
only really makes sense if the work the "clients" are doing is substantial
enough to overwhelm the communication overhead. And there are many ways to
accomplish the same task more or less efficiently (for example, doing blocks
of tasks in chunks rather than passing each one as an individual job).
But more to the
2011 Oct 17
2
Foreach (doMC)
Hello,
I am trying to run a small example with foreach, but I am having some
problems. Here is the code:
*library(doMC)
registerDoMC()
zappa = list()
frank = list()
foreach (i = 1:4) %dopar% {
zappa[[i]] = kmeans (iris[-5],4)
frank[[i]] = warnings()
}*
The code runs without error. However the zappa and frank will be empty
lists.
If I use regular *for *instead, the list will be filled up
2011 Jun 23
1
Using 'foreach' for parallel computing
Hi all,
I'm currently working on updating an R package to run for loops in parallel
to speed up computation time. I'm using the 'foreach' package with a
foreach loop. When I run my code inside the loop, I get an error message
that a number of the functions aren't recognized (even though the functions
have been defined); if I call my R package inside the loop, everything runs
2011 Jul 12
2
foreach not recognizing functions in memory
All,
I am not understanding the scoping used in foreach when it is used
inside a function. I keep getting "could not find function" errors for
functions that are in memory when I try to use foreach within a function
call. I have a simple example below. "testFun" is in memory and works
when called by foreach directly, but when I place foreach in a function
called
2011 Aug 17
1
R cmd check and multicore foreach loop
Hi,
in R 2.12.1, R CMD check hangs when building a vignette that uses a
foreach loop with the doMC parallel backend.
This does not happen in R 2.13.1, nor if I use doSEQ instead of doMC.
All versions of multicore, doMC and foreach are the same on both my R
installations.
Has anybody encountered a similar issue?
Thank you.
Renaud
###
UNIVERSITY OF CAPE TOWN
This e-mail is subject to the
2012 Nov 30
1
How to repeat replication
Dear all,
I generate data under IRT mdel. I conducted 1000 replications. When I run, some replication was not fit with my model. So, replications were fit model were less than 1000 replication. If I want its run until 1000 replicaions. How shouldI write functin.
Thank you,
Kamontip
[[alternative HTML version deleted]]
2013 Nov 14
1
issues with calling predict.coxph.penal (survival) inside a function
Thanks for the reproducable example. I can confirm that it fails on my machine using
survival 2-37.5, the next soon-to-be-released version,
The issue is with NextMethod, and my assumption that the called routine inherited
everything from the parent, including the environment chain. A simple test this AM showed
me that the assumption is false. It might have been true for Splus. Working this
2012 Aug 06
5
program of matrix
Hi
can ANY body help me to programme this formula:
c[lj] and c[l'j] are matrix
A[j]^-1 is an invertible diagonal matrix
g[ll']=i[ll'] - sum *#from j=1 to k#* c[lj]c[l'j]A[j]^-1
WHERE
i[ll']= 1/n sum from i=1 to n z[il] z[il']
n,k,m are given. j=1...k, l,l'=1...m,
it s complicate for me ; hope you can help me
thank you a lot
--
View this
2017 Nov 28
0
Discourage the weights= option of lm with summarized data
Since the three posters agree (only) that there is a bug, I propose to
file it as a bug, which is the least we can do now.
There is more to it: the only other case of a change in the Reference
Manual which I know of, is also about the weights option! This is in
coxph. The Reference Manual version 3.0.0 (2013) says about coxph:
" ... If weights is a vector of integers, then the estimated
2017 Oct 12
4
Discourage the weights= option of lm with summarized data
OK. We have now three suggestions to repair the text:
- remove the text
- add "not" at the beginning of the text
- add at the end of the text a warning; something like:
"Note that in this case the standard estimates of the parameters are
in general not correct, and hence also the t values and the p value.
Also the number of degrees of freedom is not correct. (The parameter
2012 Nov 29
1
How to use doSMP(revoIPC) with R 2.15.x version
Hello,
I'd like to use package 'doSMP'. But I can only found source codes in the CRAN.
I tried to build source code using 'r CMD build doSMP' in the source directory,
the following error is shown:
ERROR: dependencies 'foreach', 'iterators', 'revoIPC' are not available for pack
age 'doSMP'
So, i tried to install dependency packages. But I
2010 Apr 29
3
Can't load "doSMP" from REvolutionR in regular R2.11.0
Hi list,
I was testing out the "doSMP" package from REvolutionR in my regular R2.11.0 installation and I got the following error message.? Well, one obvious thing is that R2.11.0 was built using "i386-pc-mingw32" which is different from what revoIPC used.? I could just use REvolutionR, but all my R peripherals were set up to work
with the regular R2.11.0.? So, I really want
2012 Jan 25
1
Why was the ‘doSMP’ package removed from CRAN?
Hello dear list,
I just noticed that:
Package ‘doSMP’ was removed from the CRAN repository.
http://cran.r-project.org/web/packages/doSMP/index.html
Does any one know the reason for this?
Is this a technical or a legal (e.g: license) issue?
Thanks,
Tal
----------------Contact
Details:-------------------------------------------------------
Contact me: Tal.Galili@gmail.com | 972-52-7275845
2011 Feb 23
0
Ubuntu Maverick and revoIPC/doSMP
Hello,
I am having trouple installing doSMP and revoIPC from:
https://r-forge.r-project.org/R/?group_id=950
My Linux system:
Linux 2.6.35-25-generic #44-Ubuntu SMP Fri Jan 21 17:40:44 UTC 2011
x86_64 GNU/Linux
Ubuntu 10.10 \n \l
I get this reply:
costas at ELEPHANT:~/Downloads$ sudo R CMD INSTALL revoIPC_1.0-3.tar.gz
* installing to library ?/home/costas/R/x86_64-pc-linux-gnu-library/2.11?
*
2011 May 11
1
foreach(): how to do calculations "between" two foreach loops?
Dear expeRts,
is it possible to carry out calculations between different foreach() calls?
As for nested loops, you want to carry out calcuations not depending on the inner
loop only once and not for each iteration of the innermost loop.
Cheers,
Marius
library(foreach)
foreach(i=1:3) %:%
foreach(j=1:2) %do% {
i <- i+1
print(paste(i,j))
}
foreach(i=1:3) %:%
i