NITPicker

Daphne Ezer

2018-04-22

Often, researchers will conduct a few high-resolution time course experiments (or densely sample points along a spatial axis), but then they must select a subset of points to sample in follow-up experiments due to financial constraints. NITPicker is a tool to select the best points to subsample. We present three different definitions of what constitutes a `good’ set of time points:

Please note that this is not a very fast value to compute– it may take a few hours to complete on a large dataset. The precise definition and motivation for these three criteria can be found at: https://doi.org/10.1101/301796

Please note that this package relies heavily on the fdasrvf package, which is used to generate probability distributions of curves, based on a set of example functions.

References

Please cite the following if you use this R package:

Ezer, D. and Keir J.C. Selection of time points for costly experiments: a comparison between human intuition and computer-aided experimental design. bioarxiv, :10.1101/301796 (2018).


It might also be advisable to cite this paper, which presents the fdasrvf package which is an important part of this project:

Tucker, J. D., Wu, W., Srivastava, A., Generative Models for Function Data using Phase and Amplitude Separation, Computational Statistics and Data Analysis (2012), 10.1016/j.csda.2012.12.001.

For more background on why it might be useful to minimise the L2-error for finding optimal time points to sample, please see:

Michael Kleyman, Emre Sefer, Teodora Nicola, Celia Espinoza, Divya Chhabra, James S Hagood, Naftali Kaminski, Namasivayam Ambalavanan, Ziv Bar-Joseph. Selecting the most appropriate time points to profile in high-throughput studies. eLife 2017;6:e18541 (2017).

Demo of F1

In this example, we try to find 4 months to subsample that will let us estimate the shape of the curves as accurately as possible (minimise L2-error). In this case, we sample only 3 example curves from the distribution of curves when estimating the integral– this should be much higher (100 curves is usually suitable), but we make it 3 here to speed up loading the vignette.

Note that the tables that are printed as the evaluation are the optimisation tables that are used as part of the NITPicker algorithm’s dynamic programming algorithm.

library(fda)
#> Loading required package: splines
#> Loading required package: Matrix
#> 
#> Attaching package: 'fda'
#> The following object is masked from 'package:graphics':
#> 
#>     matplot
library(NITPicker)
#> Loading required package: fdasrvf
#> Loading required package: fda.usc
#> Loading required package: MASS
#> Loading required package: mgcv
#> Loading required package: nlme
#> This is mgcv 1.8-23. For overview type 'help("mgcv-package")'.
#> Loading required package: rpart
 mat=CanadianWeather$monthlyTemp #load data - a matrix with 12 rows, representing months (time); and 35 columns, representing cities (experiments)
 a=findPathF1(c(1:12), mat, 4, numPerts=500) #find a set of points that help predict the shape of the curve
#> lambda =   0.0 
#> 
#> Initializing...
#> Computing Karcher mean of 35 functions in SRSF space...
#> updating step: r=1
#> updating step: r=2
#> updating step: r=3
#> updating step: r=4
#> updating step: r=5
#> updating step: r=6
#> updating step: r=7
#> updating step: r=8
#> updating step: r=9
#> updating step: r=10
#> updating step: r=11
#> updating step: r=12
#> updating step: r=13
#> updating step: r=14
#> updating step: r=15
#> updating step: r=16
#> updating step: r=17
#> updating step: r=18
#>      [,1]
#> [1,]    0
#> [2,]  Inf
#> [3,]  Inf
#> [4,]  Inf
#> [5,]  Inf
#>          [,1] [,2]
#> [1,] 405386.3  Inf
#> [2,]      Inf    0
#> [3,]      Inf  Inf
#> [4,]      Inf  Inf
#> [5,]      Inf  Inf
#>          [,1]     [,2]     [,3]
#> [1,] 12754641      Inf      Inf
#> [2,]      Inf 402987.9 405386.3
#> [3,]      Inf      Inf      0.0
#> [4,]      Inf      Inf      Inf
#> [5,]      Inf      Inf      Inf
#>          [,1]    [,2]     [,3]       [,4]
#> [1,] 76710128     Inf      Inf        Inf
#> [2,]      Inf 2691586 566219.1 12754640.8
#> [3,]      Inf     Inf 160832.8   402987.9
#> [4,]      Inf     Inf      Inf        0.0
#> [5,]      Inf     Inf      Inf        Inf
#>           [,1]    [,2]     [,3]         [,4]       [,5]
#> [1,] 209951996     Inf      Inf          Inf        Inf
#> [2,]       Inf 5204859 698771.0 12761361.222 76710127.9
#> [3,]       Inf     Inf 293384.7   409708.318   566219.1
#> [4,]       Inf     Inf      Inf     6720.452   160832.8
#> [5,]       Inf     Inf      Inf          Inf        0.0
#>           [,1]    [,2]     [,3]       [,4]        [,5]         [,6]
#> [1,] 382507122     Inf      Inf        Inf         Inf          Inf
#> [2,]       Inf 5264874 646543.1 13106225.8 76793763.00 2.099520e+08
#> [3,]       Inf     Inf 241156.8   754572.9   649854.16 6.987710e+05
#> [4,]       Inf     Inf      Inf   351585.0   244467.88 2.933847e+05
#> [5,]       Inf     Inf      Inf        Inf    83635.07 6.720452e+03
#>           [,1]    [,2]    [,3]     [,4]     [,5]        [,6]        [,7]
#> [1,] 514207138     Inf     Inf      Inf      Inf         Inf         Inf
#> [2,]       Inf 4327509 3736712 16528427 78183000 210179365.1 382507122.0
#> [3,]       Inf     Inf 3331326  4176774  2039091    926140.2    646543.1
#> [4,]       Inf     Inf     Inf  3773786  1633705    520753.9    241156.8
#> [5,]       Inf     Inf     Inf      Inf  1472872    234089.7    244467.9
#>           [,1]     [,2]     [,3]     [,4]     [,5]      [,6]        [,7]
#> [1,] 473815404      Inf      Inf      Inf      Inf       Inf         Inf
#> [2,]       Inf 22257196 29448384 37850239 89419317 214180641 383180660.8
#> [3,]       Inf      Inf 29042997 25498586 13275408   4927416   1320081.9
#> [4,]       Inf      Inf      Inf 25095598 12870022   4522030    914695.6
#> [5,]       Inf      Inf      Inf      Inf 12709189   4235366    918006.7
#>             [,8]
#> [1,]         Inf
#> [2,] 514207138.3
#> [3,]   3736712.2
#> [4,]    646543.1
#> [5,]    241156.8
#>           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
#> [1,] 301568981       Inf       Inf       Inf       Inf       Inf       Inf
#> [2,]       Inf 113501857 122664213 110684752 132584847 234160346 389372771
#> [3,]       Inf       Inf 122258827  98333099  56440938  24907121   7512192
#> [4,]       Inf       Inf       Inf  97930111  56035552  24501735   7106806
#> [5,]       Inf       Inf       Inf       Inf  55874719  24215071   7110117
#>             [,8]        [,9]
#> [1,]         Inf         Inf
#> [2,] 514906845.6 473815403.8
#> [3,]   4436419.5  22257195.9
#> [4,]   1346250.4   1320081.9
#> [5,]    940864.1    646543.1
#>           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
#> [1,] 227383372       Inf       Inf       Inf       Inf       Inf       Inf
#> [2,]       Inf 295326609 291690105 239624085 211446143 273324356 403428583
#> [3,]       Inf       Inf 291284719 227272432 135302234  64071132  21568004
#> [4,]       Inf       Inf       Inf 226869444 134896848  63665745  21162618
#> [5,]       Inf       Inf       Inf       Inf 134736015  63379081  21165929
#>           [,8]        [,9]     [,10]
#> [1,]       Inf         Inf       Inf
#> [2,] 517438201 473900449.3 301568981
#> [3,]   6967775  22342241.4 110684752
#> [4,]   3877605   1405127.4   4436419
#> [5,]   3472219    731588.5   1320082
#>           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
#> [1,] 383414673       Inf       Inf       Inf       Inf       Inf       Inf
#> [2,]       Inf 580963702 546264276 431871174 331410271 335681857 428133989
#> [3,]       Inf       Inf 545858890 419519521 255266362 126428632  46273410
#> [4,]       Inf       Inf       Inf 419116533 254860975 126023246  45868023
#> [5,]       Inf       Inf       Inf       Inf 254700143 125736582  45871334
#>           [,8]      [,9]     [,10]     [,11]
#> [1,]       Inf       Inf       Inf       Inf
#> [2,] 523362361 474572008 301635771 227383372
#> [3,]  12891935  23013800 110751541 211446143
#> [4,]   9801765   2076686   4503209   6967775
#> [5,]   9396379   1403147   1386871   1405127
#>           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
#> [1,] 795952515       Inf       Inf       Inf       Inf       Inf       Inf
#> [2,]       Inf 906415161 828832215 641404449 460231248 401394221 453421513
#> [3,]       Inf       Inf 828426829 629052796 384087340 192140996  71560934
#> [4,]       Inf       Inf       Inf 628649808 383681953 191735610  71155548
#> [5,]       Inf       Inf       Inf       Inf 383521121 191448946  71158859
#>           [,8]      [,9]     [,10]     [,11]     [,12]
#> [1,]       Inf       Inf       Inf       Inf       Inf
#> [2,] 529088074 475106411 301651203 227393966 383414673
#> [3,]  18617648  23548203 110766973 211456737 227383372
#> [4,]  15527478   2611089   4518641   6978369  12891935
#> [5,]  15122092   1937551   1402303   1415722   2076686
#>      [,1]       [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
#> [1,]    0        Inf       Inf       Inf       Inf       Inf       Inf
#> [2,]  Inf 1058711071 865705906 510500721 276180996 322618020 544844386
#> [3,]  Inf        Inf 865300520 498149068 200037087 113364795 162983807
#> [4,]  Inf        Inf       Inf 497746081 199631701 112959409 162578421
#> [5,]  Inf        Inf       Inf       Inf 199470868 112672745 162581732
#>           [,8]      [,9]     [,10]     [,11]     [,12]     [,13]
#> [1,]       Inf       Inf       Inf       Inf       Inf       Inf
#> [2,] 745849265 682822544 411978766 265186735 387714474 795952515
#> [3,] 235378839 231264336 221094537 249249506 231683173 227393966
#> [4,] 232288670 210327222 114846204  44771138  17191735  18617648
#> [5,] 231883284 209653684 111729867  39208490   6376486   2611089
#>       [,1] [,2] [,3] [,4] [,5]
#>  [1,]    0    0    0    0    0
#>  [2,]    0    1    0    0    0
#>  [3,]    0    1    2    0    0
#>  [4,]    0    2    2    3    0
#>  [5,]    0    2    2    3    4
#>  [6,]    0    2    2    4    5
#>  [7,]    0    2    6    6    5
#>  [8,]    0    1    6    7    7
#>  [9,]    0    3    7    8    8
#> [10,]    0    4    7    8    8
#> [11,]    0   10    7    8    9
#> [12,]    0   10    7    8    9
#> [13,]    0   10    5   11   12
#>              [,1]        [,2]        [,3]         [,4]        [,5]
#>  [1,]         0.0         Inf         Inf          Inf         Inf
#>  [2,]    405386.3         0.0         Inf          Inf         Inf
#>  [3,]  12754640.8    402987.9         0.0          Inf         Inf
#>  [4,]  76710127.9    566219.1    160832.8        0.000         Inf
#>  [5,] 209951995.9    698771.0    293384.7     6720.452       0.000
#>  [6,] 382507122.0    646543.1    241156.8   244467.877    6720.452
#>  [7,] 514207138.3   3736712.2    646543.1   241156.800  234089.687
#>  [8,] 473815403.8  22257195.9   1320081.9   646543.082  241156.800
#>  [9,] 301568981.4 110684751.7   4436419.5  1320081.921  646543.082
#> [10,] 227383372.2 211446142.7   6967774.6  1405127.355  731588.515
#> [11,] 383414673.3 227383372.2  12891934.6  2076685.594 1386871.264
#> [12,] 795952514.6 227393966.3  18617647.6  2611089.346 1402303.103
#> [13,]         0.0 265186735.3 113364795.3 17191735.022 2611089.346
 print(a) #indices of months to select for follow-up experiments
#> [1]  2  6  8 12
 print(rownames(CanadianWeather$monthlyTemp)[a]) #month names selected
#> [1] "Feb" "Jun" "Aug" "Dec"

Demo of F2

In this example, we consider Canadian cities to be different experimental conditions, and we consider Resolute, Canada to be the control condition. We want to find a set of points that will enable us to estimate the profile of the difference in temperature between Resolute and other cities in Canada. In this case, we sample only 3 example curves from the distribution of curves when estimating the integral– this should be much higher (100 curves is usually suitable), but we make it 3 here to speed up loading the vignette.

Note that the tables that are printed as the evaluation are the optimisation tables that are used as part of the NITPicker algorithm’s dynamic programming algorithm.

library(fda)
library(NITPicker)
mat=CanadianWeather$monthlyTemp #load data - a matrix with 12 rows, representing months (time); and 35 columns, representing cities (experiments)
 y=CanadianWeather$monthlyTemp[,"Resolute"]
a=findPathF2(c(1:12), y, mat, 4, numPerts=500) #find a set of points that help predict the shape of the curve
#> lambda =   0.0 
#> 
#> Initializing...
#> Computing Karcher mean of 35 functions in SRSF space...
#> updating step: r=1
#> updating step: r=2
#> updating step: r=3
#> updating step: r=4
#> updating step: r=5
#> updating step: r=6
#> updating step: r=7
#> updating step: r=8
#> updating step: r=9
#> updating step: r=10
#> updating step: r=11
#> updating step: r=12
#> updating step: r=13
#> updating step: r=14
#> updating step: r=15
#> updating step: r=16
#> updating step: r=17
#> updating step: r=18
#>      [,1]
#> [1,]    0
#> [2,]  Inf
#> [3,]  Inf
#> [4,]  Inf
#> [5,]  Inf
#>          [,1] [,2]
#> [1,] 365301.9  Inf
#> [2,]      Inf    0
#> [3,]      Inf  Inf
#> [4,]      Inf  Inf
#> [5,]      Inf  Inf
#>          [,1]     [,2]     [,3]
#> [1,] 12548826      Inf      Inf
#> [2,]      Inf 431379.5 365301.9
#> [3,]      Inf      Inf      0.0
#> [4,]      Inf      Inf      Inf
#> [5,]      Inf      Inf      Inf
#>          [,1]    [,2]     [,3]       [,4]
#> [1,] 76245505     Inf      Inf        Inf
#> [2,]      Inf 2810254 526415.0 12548826.2
#> [3,]      Inf     Inf 161113.1   365301.9
#> [4,]      Inf     Inf      Inf        0.0
#> [5,]      Inf     Inf      Inf        Inf
#>           [,1]    [,2]     [,3]        [,4]       [,5]
#> [1,] 208843455     Inf      Inf         Inf        Inf
#> [2,]       Inf 5398116 655270.1 12556017.19 76245505.1
#> [3,]       Inf     Inf 289968.2   372492.91   526415.0
#> [4,]       Inf     Inf      Inf     7191.02   161113.1
#> [5,]       Inf     Inf      Inf         Inf        0.0
#>           [,1]    [,2]     [,3]       [,4]        [,5]         [,6]
#> [1,] 382591642     Inf      Inf        Inf         Inf          Inf
#> [2,]       Inf 5570194 599109.8 12883180.7 76322515.06 208843455.47
#> [3,]       Inf     Inf 233807.9   699656.4   603424.98    655270.12
#> [4,]       Inf     Inf      Inf   334354.5   238123.10    289968.23
#> [5,]       Inf     Inf      Inf        Inf    77009.99      7191.02
#>           [,1]    [,2]    [,3]     [,4]     [,5]        [,6]        [,7]
#> [1,] 515803981     Inf     Inf      Inf      Inf         Inf         Inf
#> [2,]       Inf 4487408 3595760 16234667 77682806 209072841.4 382591641.8
#> [3,]       Inf     Inf 3230458  4051143  1963716    884656.0    599109.8
#> [4,]       Inf     Inf     Inf  3685841  1598414    519354.1    233807.9
#> [5,]       Inf     Inf     Inf      Inf  1437301    236576.9    238123.1
#>           [,1]     [,2]     [,3]     [,4]     [,5]      [,6]        [,7]
#> [1,] 474631012      Inf      Inf      Inf      Inf       Inf         Inf
#> [2,]       Inf 21965495 29297649 37595429 88975900 213148069 383280728.0
#> [3,]       Inf      Inf 28932347 25411905 13256810   4959884   1288196.0
#> [4,]       Inf      Inf      Inf 25046603 12891508   4594582    922894.1
#> [5,]       Inf      Inf      Inf      Inf 12730395   4311805    927209.3
#>             [,8]
#> [1,]         Inf
#> [2,] 515803981.4
#> [3,]   3595759.9
#> [4,]    599109.8
#> [5,]    233807.9
#>           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
#> [1,] 302734286       Inf       Inf       Inf       Inf       Inf       Inf
#> [2,]       Inf 112055517 122176732 110234863 132074679 233183130 389464846
#> [3,]       Inf       Inf 121811430  98051339  56355589  24994945   7472314
#> [4,]       Inf       Inf       Inf  97686037  55990287  24629643   7107012
#> [5,]       Inf       Inf       Inf       Inf  55829174  24346866   7111328
#>             [,8]        [,9]
#> [1,]         Inf         Inf
#> [2,] 516489538.1 474631011.9
#> [3,]   4281316.7  21965494.7
#> [4,]   1284666.6   1288196.0
#> [5,]    919364.7    599109.8
#>           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
#> [1,] 227484274       Inf       Inf       Inf       Inf       Inf       Inf
#> [2,]       Inf 292375521 290788428 238942146 210853677 272413913 403500945
#> [3,]       Inf       Inf 290423127 226758622 135134587  64225728  21508413
#> [4,]       Inf       Inf       Inf 226393320 134769285  63860426  21143111
#> [5,]       Inf       Inf       Inf       Inf 134608172  63577648  21147427
#>           [,8]        [,9]     [,10]
#> [1,]       Inf         Inf       Inf
#> [2,] 518995041 474717060.6 302734286
#> [3,]   6786820  22051543.3 110234863
#> [4,]   3790169   1374244.7   4281317
#> [5,]   3424868    685158.4   1284667
#>           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
#> [1,] 378494828       Inf       Inf       Inf       Inf       Inf       Inf
#> [2,]       Inf 573737294 542688208 429175879 329491420 334082514 427774958
#> [3,]       Inf       Inf 542322906 416992355 253772329 125894329  45782426
#> [4,]       Inf       Inf       Inf 416627053 253407028 125529027  45417124
#> [5,]       Inf       Inf       Inf       Inf 253245915 125246250  45421440
#>           [,8]      [,9]     [,10]     [,11]
#> [1,]       Inf       Inf       Inf       Inf
#> [2,] 524727127 475355309 302794197 227484274
#> [3,]  12518906  22689791 110294775 210853677
#> [4,]   9522256   2012493   4341228   6786820
#> [5,]   9156954   1323406   1344578   1374245
#>           [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
#> [1,] 790692602       Inf       Inf       Inf       Inf       Inf       Inf
#> [2,]       Inf 900199197 827362190 640554158 459754086 400882270 453598670
#> [3,]       Inf       Inf 826996888 628370634 384034996 192694085  71606138
#> [4,]       Inf       Inf       Inf 628005332 383669694 192328783  71240836
#> [5,]       Inf       Inf       Inf       Inf 383508581 192046006  71245151
#>           [,8]      [,9]     [,10]     [,11]     [,12]
#> [1,]       Inf       Inf       Inf       Inf       Inf
#> [2,] 530656498 475960172 302824015 227489772 378494828
#> [3,]  18448277  23294655 110324592 210859176 227484274
#> [4,]  15451627   2617356   4371046   6792318  12518906
#> [5,]  15086325   1928270   1374396   1379743   2012493
#>      [,1]       [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
#> [1,]    0        Inf       Inf       Inf       Inf       Inf       Inf
#> [2,]  Inf 1051784935 868720034 512479240 276302970 320445911 542967197
#> [3,]  Inf        Inf 868354732 500295716 200583880 112257726 160974665
#> [4,]  Inf        Inf       Inf 499930414 200218578 111892424 160609363
#> [5,]  Inf        Inf       Inf       Inf 200057465 111609646 160613678
#>           [,8]      [,9]     [,10]     [,11]     [,12]     [,13]
#> [1,]       Inf       Inf       Inf       Inf       Inf       Inf
#> [2,] 745774319 681665462 412151468 264878522 382862284 790692602
#> [3,] 233566097 228999945 219652045 248247925 231851730 227489772
#> [4,] 230569447 208322646 113698499  44181067  16886362  18448277
#> [5,] 230204145 207633560 110701849  38768492   6379949   2617356
#>       [,1] [,2] [,3] [,4] [,5]
#>  [1,]    0    0    0    0    0
#>  [2,]    0    1    0    0    0
#>  [3,]    0    2    2    0    0
#>  [4,]    0    2    2    3    0
#>  [5,]    0    2    2    3    4
#>  [6,]    0    2    2    4    5
#>  [7,]    0    2    6    6    5
#>  [8,]    0    1    6    7    7
#>  [9,]    0    3    7    7    8
#> [10,]    0    4    7    8    8
#> [11,]    0   10    7    8    8
#> [12,]    0   10    7    8    9
#> [13,]    0   10    5   11   12
#>              [,1]        [,2]        [,3]        [,4]       [,5]
#>  [1,]         0.0         Inf         Inf         Inf        Inf
#>  [2,]    365301.9         0.0         Inf         Inf        Inf
#>  [3,]  12548826.2    365301.9         0.0         Inf        Inf
#>  [4,]  76245505.1    526415.0    161113.1        0.00        Inf
#>  [5,] 208843455.5    655270.1    289968.2     7191.02       0.00
#>  [6,] 382591641.8    599109.8    233807.9   238123.10    7191.02
#>  [7,] 515803981.4   3595759.9    599109.8   233807.90  236576.91
#>  [8,] 474631011.9  21965494.7   1288196.0   599109.78  233807.90
#>  [9,] 302734285.8 110234862.9   4281316.7  1284666.56  599109.78
#> [10,] 227484274.2 210853677.4   6786819.5  1374244.65  685158.43
#> [11,] 378494827.7 227484274.2  12518905.8  2012492.69 1323406.47
#> [12,] 790692602.2 227489772.3  18448276.8  2617356.28 1374395.56
#> [13,]         0.0 264878521.6 112257725.6 16886362.06 2617356.28
print(a) #indices of months to select for follow-up experiments
#> [1]  2  6  8 12
print(rownames(CanadianWeather$monthlyTemp)[a])
#> [1] "Feb" "Jun" "Aug" "Dec"

Demo of F3

In this example, we try to identify points that can predict the shape of the curve of the difference between the temperatures of Canadian cities that are along the Atlantic with those that are Continental– however, we don’t care too much about sampling time points where there is lots of noise, so we normalise this by the variance at each point.

In this case, we sample only 3 example curves from the distribution of curves when estimating the integral– this should be much higher (100 curves is usually suitable), but we make it 3 here to speed up loading the vignette.

Note that the tables that are printed as the evaluation are the optimisation tables that are used as part of the NITPicker algorithm’s dynamic programming algorithm.

library(fda)
library(NITPicker)
#Set up data:
atlanticCities=which(CanadianWeather$region[as.character(colnames(CanadianWeather$monthlyTemp))]=="Atlantic")
 matAtlantic=CanadianWeather$monthlyTemp[, names(atlanticCities)]
 
 continentalCities=which(CanadianWeather$region[as.character(colnames(CanadianWeather$monthlyTemp))]=="Continental")
 matContinental=CanadianWeather$monthlyTemp[, names(continentalCities)]
 
 #find a set of points that helps capture the difference between Atlantic and Continental cities, normalised by the variance
 a=findPathF3(c(1:12),  matAtlantic,  matContinental, 4, numPerts=500) #find a set of points that help predict the shape of the curve
#> lambda =   0.0 
#> 
#> Initializing...
#> Computing Karcher mean of 15 functions in SRSF space...
#> updating step: r=1
#> updating step: r=2
#> updating step: r=3
#> updating step: r=4
#> updating step: r=5
#> updating step: r=6
#> updating step: r=7
#> updating step: r=8
#> updating step: r=9
#> updating step: r=10
#> updating step: r=11
#> lambda =   0.0 
#> 
#> Initializing...
#> Computing Karcher mean of 12 functions in SRSF space...
#> updating step: r=1
#> updating step: r=2
#> updating step: r=3
#> updating step: r=4
#> updating step: r=5
#> updating step: r=6
#> lambda =   0.0 
#> 
#> Initializing...
#> Computing Karcher mean of 500 functions in SRSF space...
#> updating step: r=1
#> updating step: r=2
#> updating step: r=3
#> updating step: r=4
#> updating step: r=5
#> updating step: r=6
#> updating step: r=7
#> updating step: r=8
#> updating step: r=9
#> updating step: r=10
#> updating step: r=11
#> updating step: r=12
#> updating step: r=13
#> updating step: r=14
#> updating step: r=15
#> updating step: r=16
#> updating step: r=17
#> updating step: r=18
#> updating step: r=19
#> updating step: r=20
#> maximal number of iterations is reached. 
#>      [,1]
#> [1,]    0
#> [2,]  Inf
#> [3,]  Inf
#> [4,]  Inf
#> [5,]  Inf
#>          [,1] [,2]
#> [1,] 224.7612  Inf
#> [2,]      Inf    0
#> [3,]      Inf  Inf
#> [4,]      Inf  Inf
#> [5,]      Inf  Inf
#>          [,1]     [,2]     [,3]
#> [1,] 3384.579      Inf      Inf
#> [2,]      Inf 32.39191 224.7612
#> [3,]      Inf      Inf   0.0000
#> [4,]      Inf      Inf      Inf
#> [5,]      Inf      Inf      Inf
#>          [,1]     [,2]        [,3]       [,4]
#> [1,] 13371.38      Inf         Inf        Inf
#> [2,]      Inf 101.9706 225.0703718 3384.57875
#> [3,]      Inf      Inf   0.3091552   32.39191
#> [4,]      Inf      Inf         Inf    0.00000
#> [5,]      Inf      Inf         Inf        Inf
#>         [,1]     [,2]       [,3]         [,4]         [,5]
#> [1,] 33895.8      Inf        Inf          Inf          Inf
#> [2,]     Inf 192.7369 226.235829 3.384621e+03 1.337138e+04
#> [3,]     Inf      Inf   1.474612 3.243463e+01 1.019706e+02
#> [4,]     Inf      Inf        Inf 4.271714e-02 3.091552e-01
#> [5,]     Inf      Inf        Inf          Inf 0.000000e+00
#>         [,1]     [,2]       [,3]        [,4]         [,5]         [,6]
#> [1,] 66026.3      Inf        Inf         Inf          Inf          Inf
#> [2,]     Inf 234.5203 225.999879 3386.246720 1.337231e+04 3.389580e+04
#> [3,]     Inf      Inf   1.238662   34.059882 1.029025e+02 1.927369e+02
#> [4,]     Inf      Inf        Inf    1.667969 1.241093e+00 1.474612e+00
#> [5,]     Inf      Inf        Inf         Inf 9.319376e-01 4.271714e-02
#>          [,1]     [,2]      [,3]       [,4]        [,5]         [,6]
#> [1,] 105625.6      Inf       Inf        Inf         Inf          Inf
#> [2,]      Inf 182.7482 286.03070 3437.07130 13399.53197 33901.418189
#> [3,]      Inf      Inf  61.26948   84.88447   130.12528   198.357741
#> [4,]      Inf      Inf       Inf   52.49255    28.46387     7.095429
#> [5,]      Inf      Inf       Inf        Inf    28.15472     5.663534
#>              [,7]
#> [1,]          Inf
#> [2,] 66026.297408
#> [3,]   225.999879
#> [4,]     1.238662
#> [5,]     1.241093
#>          [,1]     [,2]     [,3]      [,4]       [,5]        [,6]
#> [1,] 150878.1      Inf      Inf       Inf        Inf         Inf
#> [2,]      Inf 248.3435 576.7843 3653.9977 13520.6577 33939.87188
#> [3,]      Inf      Inf 352.0230  301.8109   251.2510   236.81143
#> [4,]      Inf      Inf      Inf  269.4190   149.5896    45.54912
#> [5,]      Inf      Inf      Inf       Inf   149.2804    44.11722
#>              [,7]         [,8]
#> [1,]          Inf          Inf
#> [2,] 66029.630219 1.056256e+05
#> [3,]   229.332690 1.827482e+02
#> [4,]     4.571474 6.126948e+01
#> [5,]     4.573904 1.238662e+00
#>          [,1]    [,2]     [,3]      [,4]       [,5]       [,6]        [,7]
#> [1,] 199354.6     Inf      Inf       Inf        Inf        Inf         Inf
#> [2,]      Inf 711.947 1327.404 4201.6505 13842.0409 34068.0084 66056.46035
#> [3,]      Inf     Inf 1102.643  849.4636   572.6342   364.9480   256.16282
#> [4,]      Inf     Inf      Inf  817.0717   470.9728   173.6857    31.40160
#> [5,]      Inf     Inf      Inf       Inf   470.6637   172.2538    31.40403
#>              [,8]         [,9]
#> [1,]          Inf          Inf
#> [2,] 1.056283e+05 1.508781e+05
#> [3,] 1.854628e+02 2.483435e+02
#> [4,] 6.398404e+01 1.827482e+02
#> [5,] 3.953226e+00 4.571474e+00
#>          [,1]    [,2]     [,3]     [,4]      [,5]       [,6]       [,7]
#> [1,] 243212.1     Inf      Inf      Inf       Inf        Inf        Inf
#> [2,]      Inf 2196.48 3120.178 5525.334 14674.066 34472.2769 66196.5210
#> [3,]      Inf     Inf 2895.417 2173.147  1404.659   769.2165   396.2235
#> [4,]      Inf     Inf      Inf 2140.755  1302.998   577.9542   171.4623
#> [5,]      Inf     Inf      Inf      Inf  1302.689   576.5223   171.4647
#>              [,8]         [,9]       [,10]
#> [1,]          Inf          Inf         Inf
#> [2,] 105666.73651 150883.84613 199354.5620
#> [3,]    223.93149    254.13433    711.9470
#> [4,]    102.45277    188.53900    185.4628
#> [5,]     42.42196     10.36228     31.4016
#>          [,1]     [,2]     [,3]     [,4]      [,5]      [,6]       [,7]
#> [1,] 269467.5      Inf      Inf      Inf       Inf       Inf        Inf
#> [2,]      Inf 6355.351 7467.094 8822.732 16902.479 35745.660 66800.6827
#> [3,]      Inf      Inf 7242.333 5470.546  3633.072  2042.600  1000.3851
#> [4,]      Inf      Inf      Inf 5438.154  3531.410  1851.337   775.6239
#> [5,]      Inf      Inf      Inf      Inf  3531.101  1849.905   775.6263
#>             [,8]         [,9]        [,10]       [,11]
#> [1,]         Inf          Inf          Inf         Inf
#> [2,] 105924.9984 150969.41830 199367.74310 243212.0976
#> [3,]    482.1933    339.70651    725.12815   2196.4796
#> [4,]    360.7146    274.11117    198.64390    223.9315
#> [5,]    300.6838     95.93445     44.58274    102.4528
#>          [,1]    [,2]     [,3]     [,4]     [,5]      [,6]      [,7]
#> [1,] 236877.2     Inf      Inf      Inf      Inf       Inf       Inf
#> [2,]      Inf 22085.5 22552.23 20797.49 25740.71 41674.652 70426.397
#> [3,]      Inf     Inf 22327.47 17445.30 12471.30  7971.592  4626.099
#> [4,]      Inf     Inf      Inf 17412.91 12369.64  7780.329  4401.338
#> [5,]      Inf     Inf      Inf      Inf 12369.33  7778.898  4401.340
#>            [,8]       [,9]       [,10]       [,11]       [,12]
#> [1,]        Inf        Inf         Inf         Inf         Inf
#> [2,] 108030.098 152051.842 199791.6326 243302.4314 269467.4577
#> [3,]   2587.293   1422.130   1149.0177   2286.8135   6355.3509
#> [4,]   2465.814   1356.534    622.5334    314.2653    339.7065
#> [5,]   2405.783   1178.358    468.4723    192.7866    198.6439
#>      [,1]   [,2]     [,3]     [,4]     [,5]      [,6]      [,7]      [,8]
#> [1,]    0    Inf      Inf      Inf      Inf       Inf       Inf       Inf
#> [2,]  Inf 484464 386310.7 264377.3 175135.5 122961.28 108937.46 123970.09
#> [3,]  Inf    Inf 386086.0 261025.1 161866.0  89258.22  43137.16  18527.29
#> [4,]  Inf    Inf      Inf 260992.7 161764.4  89066.96  42912.40  18405.81
#> [5,]  Inf    Inf      Inf      Inf 161764.1  89065.53  42912.40  18345.78
#>            [,9]      [,10]       [,11]       [,12]       [,13]
#> [1,]        Inf        Inf         Inf         Inf         Inf
#> [2,] 157106.918 200623.769 243276.1628 269523.5473 236877.2431
#> [3,]   6477.206   1981.154   2260.5448   6411.4405  20797.4873
#> [4,]   6411.611   1454.670    287.9967    395.7961   1149.0177
#> [5,]   6233.434   1300.609    166.5180    254.7335    314.2653
#>       [,1] [,2] [,3] [,4] [,5]
#>  [1,]    0    0    0    0    0
#>  [2,]    0    1    0    0    0
#>  [3,]    0    1    2    0    0
#>  [4,]    0    1    2    3    0
#>  [5,]    0    1    2    3    4
#>  [6,]    0    2    2    4    5
#>  [7,]    0    1    2    6    6
#>  [8,]    0    1    7    6    7
#>  [9,]    0    1    7    6    7
#> [10,]    0    1    7    7    8
#> [11,]    0    1    8    9    9
#> [12,]    0    3    9   10   10
#> [13,]    0    6    9   10   10
#>              [,1]         [,2]         [,3]         [,4]         [,5]
#>  [1,]      0.0000          Inf          Inf          Inf          Inf
#>  [2,]    224.7612      0.00000          Inf          Inf          Inf
#>  [3,]   3384.5788     32.39191    0.0000000          Inf          Inf
#>  [4,]  13371.3773    101.97057    0.3091552   0.00000000          Inf
#>  [5,]  33895.7974    192.73692    1.4746119   0.04271714   0.00000000
#>  [6,]  66026.2974    225.99988    1.2386624   1.24109283   0.04271714
#>  [7,] 105625.5532    182.74819   61.2694805   1.23866236   1.24109283
#>  [8,] 150878.0553    248.34353  182.7481929   4.57147379   1.23866236
#>  [9,] 199354.5620    711.94701  185.4627562  31.40160152   3.95322559
#> [10,] 243212.0976   2196.47963  223.9314864 102.45277395  10.36227636
#> [11,] 269467.4577   6355.35088  339.7065087 198.64389934  44.58274469
#> [12,] 236877.2431  20797.48733 1149.0176650 314.26533920 192.78662674
#> [13,]      0.0000 108937.45803 1981.1542206 287.99667069 166.51795823
 print(a) #indices of months to select for follow-up experiments
#> [1]  1  2  7 10
 print(rownames(CanadianWeather$monthlyTemp)[a]) #month names selected
#> [1] "Jan" "Feb" "Jul" "Oct"