Displaying 2 results from an estimated 2 matches for "randvalues".
Did you mean:
rand_value
2011 Jul 02
5
%dopar% parallel processing experiment
dear R experts---
I am experimenting with multicore processing, so far with pretty
disappointing results. Here is my simple example:
A <- 100000
randvalues <- abs(rnorm(A))
minfn <- function( x, i ) { log(abs(x))+x^3+i/A+randvalues[i] } ?## an
arbitrary function
ARGV <- commandArgs(trailingOnly=TRUE)
if (ARGV[1] == "do-onecore") {
?library(foreach)
?discard <- foreach(i = 1:A) %do% uniroot( minfn, c(1e-20,9e20), i ) } else...
2003 Oct 06
0
randomizing within factors and combining unequal-sized arrays
...n unchanged. For example, starting with an array:
10,11,12,20,21,22,
which has been factored into two groups that lie between 10 and 19
and 20 and 29,
I want to end up with an array that might look like this:
11,10,12,22,21,20
I can generate the randomized values using a statement of the form:
randvalues = tapply(values,grouped.ranks,sample).
How do I get these randomized values back into the original
array, so that each factored subsample of the array now has its
values randomized within that subsample? At the same time, I do not
want to mix up the array too much by substituting values in on...