Displaying 3 results from an estimated 3 matches for "origfn".
Did you mean:
origen
2015 Mar 05
3
Performance issue in stats:::weighted.mean.default method
...nippet)
library(microbenchmark)
x <- sample(500,5000,replace=TRUE)
w <- sample(1000,5000,replace=TRUE)/1000 *
ifelse((sample(10,5000,replace=TRUE) -1) > 0, 1, 0)
fun.new <- function(x,w) {sum(x*w)/sum(w)}
fun.orig <- function(x,w) {sum(x*w[w!=0])/sum(w)}
print(microbenchmark(
ORIGFN = fun.orig(x,w),
NEWFN = fun.new(x,w),
times = 1000))
#results:
#Unit: microseconds
# expr min lq mean median uq max neval
# ORIGFN 190.889 194.6590 210.08952 198.847 202.928 1779.789 1000
# NEWFN 20.857 21.7175 24.61149 22.080 22.594 1744.014 1000
So...
2015 Mar 05
0
Performance issue in stats:::weighted.mean.default method
...> x <- sample(500,5000,replace=TRUE)
> w <- sample(1000,5000,replace=TRUE)/1000 *
> ifelse((sample(10,5000,replace=TRUE) -1) > 0, 1, 0)
> fun.new <- function(x,w) {sum(x*w)/sum(w)}
> fun.orig <- function(x,w) {sum(x*w[w!=0])/sum(w)}
> print(microbenchmark(
> ORIGFN = fun.orig(x,w),
> NEWFN = fun.new(x,w),
> times = 1000))
>
> #results:
> #Unit: microseconds
> # expr min lq mean median uq max neval
> # ORIGFN 190.889 194.6590 210.08952 198.847 202.928 1779.789 1000
> # NEWFN 20.857 21.7175 24.6114...
2013 May 15
1
[LLVMdev] Attributes & CloneFunctionInto
Hi John,
thanks for the pointer. However, I'd rather avoid rolling a custom
implementation. After all, it's not like I want to do something
drastically different...
I had sorted out the problem for 3.2 as well as a previous version of
3.3 trunk, but the API changed about a hundred times. Now as it
apparently has stabilized, I moved to a the 3.3 release branch just to
find that even