>X<-data[["10x10"]]
>w<- runif(nrow(X))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells3230545172.65709258305.05709258305.0Vcells686326052.422345847170.556666022432.4>colStats<- microbenchmark(colWeightedMedians= colWeightedMedians(X, w=w, na.rm=FALSE), `apply+weigthedMedian`= apply(X,
+MARGIN=2L, FUN=weightedMedian, w=w, na.rm=FALSE), unit="ms")
>X<- t(X)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells3229068172.55709258305.05709258305.0Vcells685904852.422345847170.556666022432.4>rowStats<- microbenchmark(rowWeightedMedians= rowWeightedMedians(X, w=w, na.rm=FALSE), `apply+weigthedMedian`= apply(X,
+MARGIN=1L, FUN=weightedMedian, w=w, na.rm=FALSE), unit="ms")
Table: Benchmarking of colWeightedMedians() and apply+weigthedMedian() on 10x10 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
0.034414
0.0353165
0.036865
0.0356925
0.0361500
0.142468
1
colWeightedMedians
0.042417
0.0432755
0.044040
0.0437040
0.0441705
0.062775
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
1.000000
1.000000
1.000000
1.000000
1.000000
1.0000000
1
colWeightedMedians
1.232551
1.225362
1.194627
1.224459
1.221867
0.4406253
Table: Benchmarking of rowWeightedMedians() and apply+weigthedMedian() on 10x10 data (transposed). The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
0.033587
0.034515
0.0360039
0.0348925
0.0353215
0.136032
1
rowWeightedMedians
0.041822
0.042836
0.0434889
0.0431860
0.0434855
0.064376
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
1.000000
1.000000
1.000000
1.000000
1.000000
1.0000000
1
rowWeightedMedians
1.245184
1.241084
1.207895
1.237687
1.231134
0.4732416
Figure: Benchmarking of colWeightedMedians() and apply+weigthedMedian() on 10x10 data as well as rowWeightedMedians() and apply+weigthedMedian() on the same data transposed. Outliers are displayed as crosses. Times are in milliseconds.
Table: Benchmarking of colWeightedMedians() and rowWeightedMedians() on 10x10 data (original and transposed). The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
rowWeightedMedians
41.822
42.8360
43.48893
43.186
43.4855
64.376
1
colWeightedMedians
42.417
43.2755
44.03998
43.704
44.1705
62.775
expr
min
lq
mean
median
uq
max
2
rowWeightedMedians
1.000000
1.00000
1.000000
1.000000
1.000000
1.0000000
1
colWeightedMedians
1.014227
1.01026
1.012671
1.011995
1.015752
0.9751305
Figure: Benchmarking of colWeightedMedians() and rowWeightedMedians() on 10x10 data (original and transposed). Outliers are displayed as crosses. Times are in milliseconds.
100x100 matrix
>X<-data[["100x100"]]
>w<- runif(nrow(X))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells3227620172.45709258305.05709258305.0Vcells647387949.422345847170.556666022432.4>colStats<- microbenchmark(colWeightedMedians= colWeightedMedians(X, w=w, na.rm=FALSE), `apply+weigthedMedian`= apply(X,
+MARGIN=2L, FUN=weightedMedian, w=w, na.rm=FALSE), unit="ms")
>X<- t(X)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells3227611172.45709258305.05709258305.0Vcells648391749.522345847170.556666022432.4>rowStats<- microbenchmark(rowWeightedMedians= rowWeightedMedians(X, w=w, na.rm=FALSE), `apply+weigthedMedian`= apply(X,
+MARGIN=1L, FUN=weightedMedian, w=w, na.rm=FALSE), unit="ms")
Table: Benchmarking of colWeightedMedians() and apply+weigthedMedian() on 100x100 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
0.653854
0.6767645
0.6846320
0.6831130
0.6882005
0.805764
1
colWeightedMedians
0.704007
0.7319885
0.7369661
0.7388305
0.7430675
0.766118
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
1.000000
1.0000
1.000000
1.000000
1.000000
1.000000
1
colWeightedMedians
1.076704
1.0816
1.076441
1.081564
1.079725
0.950797
Table: Benchmarking of rowWeightedMedians() and apply+weigthedMedian() on 100x100 data (transposed). The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
0.613283
0.6326505
0.6433630
0.6416485
0.6508290
0.834961
1
rowWeightedMedians
0.662970
0.6789810
0.6977486
0.6984910
0.7112255
0.770928
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
1.000000
1.000000
1.000000
1.000000
1.000000
1.0000000
1
rowWeightedMedians
1.081018
1.073232
1.084533
1.088588
1.092799
0.9233102
Figure: Benchmarking of colWeightedMedians() and apply+weigthedMedian() on 100x100 data as well as rowWeightedMedians() and apply+weigthedMedian() on the same data transposed. Outliers are displayed as crosses. Times are in milliseconds.
Table: Benchmarking of colWeightedMedians() and rowWeightedMedians() on 100x100 data (original and transposed). The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
rowWeightedMedians
662.970
678.9810
697.7486
698.4910
711.2255
770.928
1
colWeightedMedians
704.007
731.9885
736.9661
738.8305
743.0675
766.118
expr
min
lq
mean
median
uq
max
2
rowWeightedMedians
1.000000
1.000000
1.000000
1.000000
1.000000
1.0000000
1
colWeightedMedians
1.061899
1.078069
1.056206
1.057752
1.044771
0.9937608
Figure: Benchmarking of colWeightedMedians() and rowWeightedMedians() on 100x100 data (original and transposed). Outliers are displayed as crosses. Times are in milliseconds.
1000x10 matrix
>X<-data[["1000x10"]]
>w<- runif(nrow(X))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells3226997172.45709258305.05709258305.0Vcells645187749.322345847170.556666022432.4>colStats<- microbenchmark(colWeightedMedians= colWeightedMedians(X, w=w, na.rm=FALSE), `apply+weigthedMedian`= apply(X,
+MARGIN=2L, FUN=weightedMedian, w=w, na.rm=FALSE), unit="ms")
>X<- t(X)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells3226988172.45709258305.05709258305.0Vcells646191549.422345847170.556666022432.4>rowStats<- microbenchmark(rowWeightedMedians= rowWeightedMedians(X, w=w, na.rm=FALSE), `apply+weigthedMedian`= apply(X,
+MARGIN=1L, FUN=weightedMedian, w=w, na.rm=FALSE), unit="ms")
Table: Benchmarking of colWeightedMedians() and apply+weigthedMedian() on 1000x10 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
0.576738
0.5898190
0.5987584
0.596093
0.6094355
0.654816
1
colWeightedMedians
0.595121
0.6048425
0.6180627
0.616453
0.6304220
0.686339
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
1.000000
1.000000
1.00000
1.000000
1.000000
1.00000
1
colWeightedMedians
1.031874
1.025471
1.03224
1.034156
1.034436
1.04814
Table: Benchmarking of rowWeightedMedians() and apply+weigthedMedian() on 1000x10 data (transposed). The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
0.535405
0.542933
0.5565937
0.5527315
0.5657045
0.665231
1
rowWeightedMedians
0.554885
0.562550
0.5782437
0.5743815
0.5869250
0.695733
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
1.000000
1.000000
1.000000
1.000000
1.000000
1.000000
1
rowWeightedMedians
1.036384
1.036131
1.038897
1.039169
1.037512
1.045852
Figure: Benchmarking of colWeightedMedians() and apply+weigthedMedian() on 1000x10 data as well as rowWeightedMedians() and apply+weigthedMedian() on the same data transposed. Outliers are displayed as crosses. Times are in milliseconds.
Table: Benchmarking of colWeightedMedians() and rowWeightedMedians() on 1000x10 data (original and transposed). The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
rowWeightedMedians
554.885
562.5500
578.2437
574.3815
586.925
695.733
1
colWeightedMedians
595.121
604.8425
618.0626
616.4530
630.422
686.339
expr
min
lq
mean
median
uq
max
2
rowWeightedMedians
1.000000
1.00000
1.000000
1.000000
1.00000
1.0000000
1
colWeightedMedians
1.072512
1.07518
1.068862
1.073247
1.07411
0.9864977
Figure: Benchmarking of colWeightedMedians() and rowWeightedMedians() on 1000x10 data (original and transposed). Outliers are displayed as crosses. Times are in milliseconds.
10x1000 matrix
>X<-data[["10x1000"]]
>w<- runif(nrow(X))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells3227195172.45709258305.05709258305.0Vcells645170249.322345847170.556666022432.4>colStats<- microbenchmark(colWeightedMedians= colWeightedMedians(X, w=w, na.rm=FALSE), `apply+weigthedMedian`= apply(X,
+MARGIN=2L, FUN=weightedMedian, w=w, na.rm=FALSE), unit="ms")
>X<- t(X)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells3227186172.45709258305.05709258305.0Vcells646174049.322345847170.556666022432.4>rowStats<- microbenchmark(rowWeightedMedians= rowWeightedMedians(X, w=w, na.rm=FALSE), `apply+weigthedMedian`= apply(X,
+MARGIN=1L, FUN=weightedMedian, w=w, na.rm=FALSE), unit="ms")
Table: Benchmarking of colWeightedMedians() and apply+weigthedMedian() on 10x1000 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
2.172776
2.408167
2.541653
2.471104
2.544382
8.466055
1
colWeightedMedians
2.643734
2.912365
3.051955
2.985746
3.057475
9.222259
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
1.000000
1.00000
1.000000
1.000000
1.000000
1.000000
1
colWeightedMedians
1.216754
1.20937
1.200775
1.208264
1.201658
1.089322
Table: Benchmarking of rowWeightedMedians() and apply+weigthedMedian() on 10x1000 data (transposed). The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
2.159425
2.401065
2.476082
2.474407
2.532453
3.375131
1
rowWeightedMedians
2.618450
2.898156
3.155197
2.966784
3.045298
9.044380
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
1.000000
1.000000
1.00000
1.000000
1.000000
1.000000
1
rowWeightedMedians
1.212568
1.207029
1.27427
1.198988
1.202509
2.679712
Figure: Benchmarking of colWeightedMedians() and apply+weigthedMedian() on 10x1000 data as well as rowWeightedMedians() and apply+weigthedMedian() on the same data transposed. Outliers are displayed as crosses. Times are in milliseconds.
Table: Benchmarking of colWeightedMedians() and rowWeightedMedians() on 10x1000 data (original and transposed). The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
rowWeightedMedians
2.618450
2.898156
3.155197
2.966784
3.045298
9.044380
1
colWeightedMedians
2.643734
2.912365
3.051955
2.985746
3.057475
9.222259
expr
min
lq
mean
median
uq
max
2
rowWeightedMedians
1.000000
1.000000
1.0000000
1.000000
1.000000
1.000000
1
colWeightedMedians
1.009656
1.004903
0.9672786
1.006392
1.003999
1.019667
Figure: Benchmarking of colWeightedMedians() and rowWeightedMedians() on 10x1000 data (original and transposed). Outliers are displayed as crosses. Times are in milliseconds.
100x1000 matrix
>X<-data[["100x1000"]]
>w<- runif(nrow(X))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells3227382172.45709258305.05709258305.0Vcells645229649.322345847170.556666022432.4>colStats<- microbenchmark(colWeightedMedians= colWeightedMedians(X, w=w, na.rm=FALSE), `apply+weigthedMedian`= apply(X,
+MARGIN=2L, FUN=weightedMedian, w=w, na.rm=FALSE), unit="ms")
>X<- t(X)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells3227376172.45709258305.05709258305.0Vcells655233950.022345847170.556666022432.4>rowStats<- microbenchmark(rowWeightedMedians= rowWeightedMedians(X, w=w, na.rm=FALSE), `apply+weigthedMedian`= apply(X,
+MARGIN=1L, FUN=weightedMedian, w=w, na.rm=FALSE), unit="ms")
Table: Benchmarking of colWeightedMedians() and apply+weigthedMedian() on 100x1000 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
6.335133
6.735972
6.968173
6.795899
6.859356
22.81473
1
colWeightedMedians
6.894953
7.324806
7.795424
7.393520
7.537198
23.18486
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
1.000000
1.000000
1.000000
1.000000
1.00000
1.000000
1
colWeightedMedians
1.088367
1.087416
1.118719
1.087938
1.09882
1.016223
Table: Benchmarking of rowWeightedMedians() and apply+weigthedMedian() on 100x1000 data (transposed). The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
5.956803
6.321299
6.941218
6.359146
6.425687
23.89361
1
rowWeightedMedians
6.487969
6.814432
6.997135
6.872865
6.939459
10.44708
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
1.00000
1.000000
1.000000
1.000000
1.000000
1.0000000
1
rowWeightedMedians
1.08917
1.078011
1.008056
1.080784
1.079956
0.4372332
Figure: Benchmarking of colWeightedMedians() and apply+weigthedMedian() on 100x1000 data as well as rowWeightedMedians() and apply+weigthedMedian() on the same data transposed. Outliers are displayed as crosses. Times are in milliseconds.
Table: Benchmarking of colWeightedMedians() and rowWeightedMedians() on 100x1000 data (original and transposed). The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
rowWeightedMedians
6.487969
6.814432
6.997135
6.872865
6.939459
10.44708
1
colWeightedMedians
6.894953
7.324806
7.795424
7.393520
7.537198
23.18486
expr
min
lq
mean
median
uq
max
2
rowWeightedMedians
1.000000
1.000000
1.000000
1.000000
1.000000
1.000000
1
colWeightedMedians
1.062729
1.074896
1.114088
1.075755
1.086136
2.219267
Figure: Benchmarking of colWeightedMedians() and rowWeightedMedians() on 100x1000 data (original and transposed). Outliers are displayed as crosses. Times are in milliseconds.
1000x100 matrix
>X<-data[["1000x100"]]
>w<- runif(nrow(X))
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells3227572172.45709258305.05709258305.0Vcells645385049.322345847170.556666022432.4>colStats<- microbenchmark(colWeightedMedians= colWeightedMedians(X, w=w, na.rm=FALSE), `apply+weigthedMedian`= apply(X,
+MARGIN=2L, FUN=weightedMedian, w=w, na.rm=FALSE), unit="ms")
>X<- t(X)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells3227563172.45709258305.05709258305.0Vcells655388850.122345847170.556666022432.4>rowStats<- microbenchmark(rowWeightedMedians= rowWeightedMedians(X, w=w, na.rm=FALSE), `apply+weigthedMedian`= apply(X,
+MARGIN=1L, FUN=weightedMedian, w=w, na.rm=FALSE), unit="ms")
Table: Benchmarking of colWeightedMedians() and apply+weigthedMedian() on 1000x100 data. The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
5.174672
5.421680
8.084785
5.450757
5.519330
255.12654
1
colWeightedMedians
5.253931
5.485418
5.658828
5.512492
5.590269
14.12993
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
1.000000
1.000000
1.0000000
1.000000
1.000000
1.000000
1
colWeightedMedians
1.015317
1.011756
0.6999355
1.011326
1.012853
0.055384
Table: Benchmarking of rowWeightedMedians() and apply+weigthedMedian() on 1000x100 data (transposed). The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
5.271997
5.455296
5.707209
5.493001
5.540624
14.16726
1
rowWeightedMedians
5.296073
5.529117
5.656510
5.551160
5.603319
13.57193
expr
min
lq
mean
median
uq
max
2
apply+weigthedMedian
1.000000
1.000000
1.0000000
1.000000
1.000000
1.0000000
1
rowWeightedMedians
1.004567
1.013532
0.9911167
1.010588
1.011316
0.9579784
Figure: Benchmarking of colWeightedMedians() and apply+weigthedMedian() on 1000x100 data as well as rowWeightedMedians() and apply+weigthedMedian() on the same data transposed. Outliers are displayed as crosses. Times are in milliseconds.
Table: Benchmarking of colWeightedMedians() and rowWeightedMedians() on 1000x100 data (original and transposed). The top panel shows times in milliseconds and the bottom panel shows relative times.
expr
min
lq
mean
median
uq
max
1
colWeightedMedians
5.253931
5.485418
5.658828
5.512492
5.590269
14.12993
2
rowWeightedMedians
5.296073
5.529117
5.656510
5.551160
5.603319
13.57193
expr
min
lq
mean
median
uq
max
1
colWeightedMedians
1.000000
1.000000
1.0000000
1.000000
1.000000
1.0000000
2
rowWeightedMedians
1.008021
1.007966
0.9995903
1.007015
1.002334
0.9605098
Figure: Benchmarking of colWeightedMedians() and rowWeightedMedians() on 1000x100 data (original and transposed). Outliers are displayed as crosses. Times are in milliseconds.