Displaying 1 result from an estimated 1 matches for "thresh2".
Did you mean:
thresh
2008 Jan 28
0
Grid search: avoid "for" loops thanks to apply&co?
...low), 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 don't
succeed. Many packages use grid search but all with "for" loops and
small number of values. To u...