search for: secondthresh

Displaying 1 result from an estimated 1 matches for "secondthresh".

2008 Jan 28
0
Grid search: avoid "for" loops thanks to apply&co?
...mes (for my case: 300x150=45'000). Transcription of the Matlab code into R is inefficient because of the loops (very slow), a schema of the actual code gives: for(in in 1:length(thres1)) firstThresh<-tresh1[i] for(j in 1:length(thres1)) if(j>i) secondThresh<-tresh1[j] regime1<-ifelse(x<thresh1)*x regime2<-ifelse(x>thresh2)*x ...(some matrix algebra in order to obtain the Sum of Squares of cbind(x, regime1, regime2) I'm trying to implement it into R with apply&co instead, but...