search for: sum4

Displaying 6 results from an estimated 6 matches for "sum4".

Did you mean: sum
2012 Jun 04
1
simulation of modified bartlett's test
...#calculate B B=((N-k)*(log(A)))-((n1-1)*log(v1)+(n2-1)*log(v2)+(n3-1)*log(v3)) #calculate C C=1+(1/(3*(k-1))*(((1/(n1-1))+(1/(n2-1))+(1/(n3-1)))-(1/(N-k)))) #calculate layard estimator xbar1=mean(g1) xbar2=mean(g2) xbar3=mean(g3) sum1=sum((g1-xbar1)^4) sum2=sum((g2-xbar2)^4) sum3=sum((g3-xbar3)^4) sum4=sum((g1-xbar1)^2) sum5=sum((g2-xbar2)^2) sum6=sum((g3-xbar3)^2) y= (N*(sum1+sum2+sum3))/((sum4+sum5+sum6)^2) #calculate bartlett modified statistic bar2=B/(C*(1/2)*(y-1)) bar2 pv[i]<-pchisq(bar2,2,lower=FALSE) } mean(pv<0.01) mean(pv<0.05) -- View this message in context: http://r.789695...
2007 Apr 03
1
Speex ARM4 patch
The attached patch eliminates some warnings while compiling for ARM4 targets. It also simplifies the asm constraints a bit. Now we can use the ARM4 optimisations when compiling for PortalPlayer targets in Rockbox. Cheers, Dan -------------- next part -------------- A non-text attachment was scrubbed... Name: speex_arm4.patch Type: text/x-diff Size: 1550 bytes Desc: not available Url :
2007 Feb 01
3
Help with efficient double sum of max (X_i, Y_i) (X & Y vectors)
...mentation - any pointers to more efficient computation greatly appreciated. nx <- length(x) ny <- length(y) sum1 <- 0 sum3 <- 0 for(i in 1:nx) { sum1 <- sum1 + sum(ifelse(x[i]>x,x[i],x)) sum3 <- sum3 + sum(ifelse(x[i]>y,x[i],y)) } sum2 <- 0 sum4 <- sum3 # symmetric and identical for(i in 1:ny) { sum2 <- sum2 + sum(ifelse(y[i]>y,y[i],y)) } Thanks in advance for your help. -- Jeff -- Professor J. S. Racine Phone: (905) 525 9140 x 23825 Department of Economics FAX: (905) 521-8232 McMaster Universit...
2011 Nov 14
0
[LLVMdev] algebraic (de)optimizations form long chains of dependent operations
Hi, when I compile (clang -O3) and optimize (opt -O3) C-code like this: sum1 = val1 + val2; sum2 = val3 + val4; sum3 = val5 + val6; sum4 = val7 + val8; sum5 = sum1 + sum2; sum6 = sum3 + sum4; sum7 = sum5 + sum6; sum += sum7; I get bitcode like this: if.end152: ; preds = %if.then150, %if.else146, %if.end137 %val8.0 = phi i32 [ -2048, %if.then150 ], [ %conv38, %if.el...
2004 Aug 06
2
[PATCH] Make SSE Run Time option. Add Win32 SSE code
...quot;speex.h" #include "speex_bits.h" -#ifdef _USE_SSE -#include "ltp_sse.h" -#else -static float inner_prod(float *x, float *y, int len) +extern int global_use_mmx_sse; + +static float inner_prod(float *a, float *b, int len) { - int i; - float sum1=0,sum2=0,sum3=0,sum4=0; - for (i=0;i<len;) - { - sum1 += x[i]*y[i]; - sum2 += x[i+1]*y[i+1]; - sum3 += x[i+2]*y[i+2]; - sum4 += x[i+3]*y[i+3]; - i+=4; - } - return sum1+sum2+sum3+sum4; -} + if (!(global_use_mmx_sse & SPEEX_ASM_MMX_SSE_FP)) + { +/* +//Older, slower ver...
2015 Jun 01
2
sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...
I'm observing that base::sum(x, na.rm=FALSE) for typeof(x) == "double" is much more time consuming when there are missing values versus when there are not. I'm observing this on both Window and Linux, but it's quite surprising to me. Currently, my main suspect is settings in on how R was built. The second suspect is my brain. I hope that someone can clarify the below