similar to: avoiding the sample in built function

Displaying 20 results from an estimated 2000 matches similar to: "avoiding the sample in built function"

2008 Jan 29
1
for loop help
Hi, I have written the following code which works fine step<-5 numSim<-15 N<-double(numSim) A<-double(numSim) F<-double(numSim) M<-double(numSim) genx<-double(numSim) for (i in 1:numSim) { N[i]<-20 PN<-(runif(N[i], 0, 1)) A[i]<-sum(ifelse(PN>0.2, 1, 0)) PF<- runif((A[i]*0.5), 0, 1) F[i]<-sum(ifelse(PF>0.2, 1, 0)) PM<-
2011 Feb 28
1
Transforming list into an array
Hello. I have the following object which is a list of length NumSim with each entry being a matrix of dimensions Ncurvas x 3: dW = replicate(NumSim,cbind(rnorm(Ncurvas),rnorm(Ncurvas),rnorm(Ncurvas)),simplify=F) I would like to transform it into an array of dimension Ncurvas x 3 x NumSim. Does anybody does how to do this? or how to generate directly and array composed of independent random
2011 May 06
1
Uniroot - error
Hi, I have tried to use uniroot to solve a value (value a in my function) that gives f=0, and I repeat this process for 10000 times(stimulations). However error occures from the 4625th stimulation - Error in uniroot(f, c(0, 2), maxiter = 1000, tol = 0.001) : f() values at end points not of opposite sign I have also tried interval of (lower=min(U), upper=max(U)) and it won't work as well.
2011 Jan 17
2
Difficult with round() function
Dear list, I'm writing a function to re-grid a data set from finer to coarser resolutions in R as follows (I use this function with sapply/apply): gridResize <- function(startVec = stop("What's your input vector"), to = stop("Missing 'to': How long do you want the fnial vector to be?")){ from <- length(startVec) shortVec<-numeric() tics <- from*to
2011 Nov 07
4
rearrange set of items randomly
Dear all, I hope that this question is not too weird, I will try to explain it as good as I can. I have to write a function for a school project and one limitation is that I may not use the in built function sample() At one point in the function I would like to resample/rearrange the items of my sample (so I would want to use sample, but I am not allowed to do so), so I have to come up with sth
2006 Nov 29
12
ssl certificate problem
I''ve tried to implement puppetmaster High Availability (mon+heartbeat). Herefore, the puppet client and puppet master are running on both servers. When the puppet client starts up, it generates a certificate, public and private key for the machine it runs on. When the puppet master starts up, it changes something so that the puppet client have no valid certificate anymore (the
2009 Apr 03
1
Trouble extracting graphic results from a bootstrap
Hi, I'm trying to extract a histogram over the results from a bootstrap. However I keep receiving the error message "Error in hist.default(boot.lrtest$ll, breaks = "scott") : 'x' must be numeric". The bootstrap I'm running looks like: > boot.test <- function(data, indeces, maxit=20) { + y1 <- fit1+e1[indeces] + mod1 <- glm(y1 ~ X1-1, maxit=maxit) +
2005 Jul 10
5
Indices and totals
Hi all! I've read http://reactor-core.org/ogg-tagging.html and http://www.vorbis.com/ot/20030303.html#id2726753 about the goals and non-goals of vorbis comments, but I'm still unsure: 1) Is it by purpose to forget about CDA's index feature because it's so rarely used or did nobody here ever thought about it? -> Add an INDEXNUMER field? 2) If "Vorbis comments are the
2012 May 18
3
How to fix indeces in a loop
Dear Contributors, I have an easy question for you which is puzzling me instead. I am running loops similar to the following: for (i in c(100,1000,10000)){ print((mean(i))) #var<-var(rnorm(i,0,1)) } This is what I obtain: [1] 100 [1] 1000 [1] 10000 In this case I ask the software to print out the result, but I would like to store it in an object. I have tried a second loop, because if I
2009 Aug 07
0
[LLVMdev] Extending Backends in LLVM-based projects
Hello everybody, I'd like to know if there is way to extend an LLVM-backend outside the LLVM-tree. I am working on a transformation system between time- and event-triggered real-time systems and at some point I need to do a WCET analysis. Herefore, I extended the AsmPrinter to give me the asm code for every single basic block. This code then is analyzed by some external tool and the analysis
2013 Mar 13
1
merging a dataframe or vectors
Hi, I would like to know what is the easiest way to compile two or more set of vectors or data frame, according to their index. They are interrelated to one another by their assigned index. for example: #data set 1 abc #output: X403 X408 X410 X415 X418 X419 X420 X423 X424 X425 X426 X427 549.58 541.91 544.18 549.37 555.54 540.83 543.26 544.26 546.85 548.98 553.10 556.49
2004 Nov 14
1
overflow in RExcel (PR#7368)
Full_Name: Isto Aho Version: 2.0.0 OS: Windows XP Submission from: (NULL) (80.186.9.143) Hi, The bug can be reproduced as follows. Install R 2.0.0 and RExcel. Take an excel sheet having 65000 rows and 11 columns, integer values. Give the 'context' command 'put R val' for the large enough selection of rows. (I didn't check, how many are needed, but it seems that 10000 rows
2006 Sep 19
1
Exc CB Search very little Question
Hi, Jean-Marc Valin wrote: > How about this: the codebook search gives you the N best (in order) > combinations of entries for the current sub-frame. You can simply > compute a one-bit checksum on all the codebook entries and choose > which of the N-best to use based on that and the "message" you have. So you're suggesting, I can either write into the stream: -
2010 Oct 07
2
Counting unique items in a list of matrices
Hello, I gave a list of 2 x 2 matrices called matlist. I have about 5000 2 x 2 matrices. I would like to count how many of each 2 x 2 unique matrix I have. So I am thinking that I need a list of the unique 2 x 2 matrices and their counts. Can anyone help. -- Thanks, Jim. [[alternative HTML version deleted]]
2011 Aug 02
0
[LLVMdev] "icmp sgt" when it should be "ugt" ?
On Aug 2, 2011, at 8:53 AM, Duncan Sands wrote: > Hi Eli, > >>>> Icmp sgt is correct. >>> >>> while ugt would be wrong, I think sgt is too! >>> >>> For example, suppose %buf is 0 and %bufLen is ~0U. Then %add.ptr is ~0U, and >>> %cmp is true, so control branches to %if.then. However in the optimized version >>> %cmp is
2007 May 14
1
cross-validation / sensitivity anaylsis for logistic regression model
Hi, I have developed a logistic regression model in the form of (factor_1~ numeric + factor_2) and would like to perform a cross-validation or some similar form of sensitivity analysis on this model. using cv.glm() from the boot package: # dataframe from which model was built in 'z' # model is called 'm_geo.lrm' # as suggested in the man page for a binomial model: cost <-
2011 Aug 02
3
[LLVMdev] "icmp sgt" when it should be "ugt" ?
Hi Eli, >>> Icmp sgt is correct. >> >> while ugt would be wrong, I think sgt is too! >> >> For example, suppose %buf is 0 and %bufLen is ~0U. Then %add.ptr is ~0U, and >> %cmp is true, so control branches to %if.then. However in the optimized version >> %cmp is false and control branches to %if.end. >> >> The GEP does have an inbounds
2018 Feb 02
1
R-gui sessions end when executing C-code
Hi I'm trying to develop some C code to find the fixpoint of a contraction mapping, the code compiles and gives the right results when executed in R. However R-gui session is frequently terminated. I'm suspecting some access violation error due to the exception code 0xc0000005 In the error report windows 10 gives me. It is the first time I'm writing any C-code so I'm guessing I
2007 May 21
3
an array of matrices
I'd like to have a three dimensional array of matrices. I thought I could construct a five dimensional array to have the three dimensional array of matrices. However, not all of the matrices in the array have the same dimensions, which seems to mean I can't use a five dimensional array. What I'd like is this: A = matrix(1:4,2,2) B = matrix(1:25,5,5) C = matrix(1,3,3) D =
2006 Sep 19
2
Exc CB Search very little Question
Hi, Jean-Marc Valin wrote: >> 1. What is the point in multiplying a codebook index with some number >> ant adding a loop variable to it as done in the exc unquant function. >> for (j=0;j<subvect_size;j++) >> exc[subvect_size*i+j]+=s*0.03125*shape_cb[ind[i]*subvect_size+j]; > > That's just how you represent a 2D array in C: the codebook has