#2: Decreasing calculation time
Nadege Belouard1
2024-08-22
Source:vignettes/020_Decreasing_calculation_time.Rmd
020_Decreasing_calculation_time.Rmd
Aim and setup
In case of extremely large species occurrence datasets, it may take a
long time to run the analyses. Any number of sectors will provide the
accurate results. However, computational time may be decreased by
increasing the number of sectors considered. The higher the number of
sectors, the larger the invasion radius at which points are compared by
pairs in find_thresholds
, so the fewer distances need to be
calculated. However, the lower the number of sectors, the better
pre-identification of spatial discontinuities and the more pruned the
list of potential jumps, so the faster find_jumps
. The
lowest computational time is therefore obtained by a trade-off between
dataset size, invasion radius, and number of sectors.
We demonstrate the effect of the number of sectors on computational time on the SLF dataset.
Load the grid data created in the first vignette
Compare calculation times
Run the jumpID functions successively for 16, 40, and 80 sectors and compare computation times.
## [1] "Sectors: 16"
## 2024-08-22 14:53:41.64369 Start sector attribution... Sector attribution completed.
## 2024-08-22 14:53:41.686407 Start finding thresholds... Sector 1/16... 2/16... 3/16... 4/16... 5/16... 6/16... 7/16... 8/16... 9/16... 10/16... 11/16... 12/16... 13/16... 14/16... 15/16... 16/16
## Threshold analysis done. 4243 potential jumps were found.
## 2024-08-22 14:59:53.712392 Start finding jumps... Year 2014 ... Year 2015 ... Year 2016 ... Year 2017 ... Year 2018 ... Year 2019 ... Year 2020 ... Year 2021 ... Year 2022 ... Jump analysis done. 387 jumps were identified.
## 2024-08-22 15:00:15.857648 Start finding secondary diffusion... Year 2017 ...Year 2018 ...Year 2019 ...Year 2020 ...Year 2021 ...Year 2022 ...Analysis of secondary diffusion done.
## [1] "Sectors: 40"
## 2024-08-22 15:01:23.338102 Start sector attribution... Sector attribution completed.
## 2024-08-22 15:01:23.357757 Start finding thresholds... Sector 1/40... 2/40... 3/40... 4/40... 5/40... 6/40... 7/40... 8/40... 9/40... 10/40... 11/40... 12/40... 13/40... 14/40... 15/40... 16/40... 17/40... 18/40... 19/40... 20/40... 21/40... 22/40... 23/40... 24/40... 25/40... 26/40... 27/40... 28/40... 29/40... 30/40... 31/40... 32/40... 33/40... 34/40... 35/40... 36/40... 37/40... 38/40... 39/40... 40/40
## Threshold analysis done. 3747 potential jumps were found.
## 2024-08-22 15:03:14.950368 Start finding jumps... Year 2014 ... Year 2015 ... Year 2016 ... Year 2017 ... Year 2018 ... Year 2019 ... Year 2020 ... Year 2021 ... Year 2022 ... Jump analysis done. 387 jumps were identified.
## 2024-08-22 15:03:36.875957 Start finding secondary diffusion... Year 2016 ...Year 2017 ...Year 2018 ...Year 2019 ...Year 2020 ...Year 2021 ...Year 2022 ...Analysis of secondary diffusion done.
## [1] "Sectors: 80"
## 2024-08-22 15:04:21.741394 Start sector attribution... Sector attribution completed.
## 2024-08-22 15:04:21.760537 Start finding thresholds... Sector 1/80... 2/80... 3/80... 4/80... 5/80... 6/80... 7/80... 8/80... 9/80... 10/80... 11/80... 12/80... 13/80... 14/80... 15/80... 16/80... 17/80... 18/80... 19/80... 20/80... 21/80... 22/80... 23/80... Warning: no negative survey in the gap identified in sector 23 and year 2021 after 106 km. The spatial discontinuity that is identified may be due to few surveys done in this area, or space divided into too many sectors. Consider decreasing the number of sectors
## Warning: no negative survey in the gap identified in sector 23 and year 2022 after 106 km. The spatial discontinuity that is identified may be due to few surveys done in this area, or space divided into too many sectors. Consider decreasing the number of sectors
## 24/80... 25/80... 26/80... 27/80... 28/80... 29/80... 30/80... 31/80... 32/80... 33/80... Warning: no negative survey in the gap identified in sector 33 and year 2019 after 113 km. The spatial discontinuity that is identified may be due to few surveys done in this area, or space divided into too many sectors. Consider decreasing the number of sectors
## Warning: no negative survey in the gap identified in sector 33 and year 2020 after 113 km. The spatial discontinuity that is identified may be due to few surveys done in this area, or space divided into too many sectors. Consider decreasing the number of sectors
## 34/80... 35/80... 36/80... 37/80... 38/80... 39/80... 40/80... 41/80... 42/80... 43/80... 44/80... 45/80... 46/80... 47/80... 48/80... 49/80... 50/80... 51/80... 52/80... 53/80... 54/80... 55/80... 56/80... 57/80... 58/80... 59/80... 60/80... 61/80... 62/80... 63/80... 64/80... 65/80... 66/80... 67/80... 68/80... 69/80... 70/80... 71/80... 72/80... 73/80... 74/80... 75/80... 76/80... 77/80... 78/80... 79/80... 80/80
## Threshold analysis done. 5034 potential jumps were found.
## 2024-08-22 15:04:40.929554 Start finding jumps... Year 2014 ... Year 2015 ... Year 2016 ... Year 2017 ... Year 2018 ... Year 2019 ... Year 2020 ... Year 2021 ... Year 2022 ... Jump analysis done. 387 jumps were identified.
## 2024-08-22 15:05:14.605223 Start finding secondary diffusion... Year 2016 ...Year 2017 ...Year 2018 ...Year 2019 ...Year 2020 ...Year 2021 ...Year 2022 ...Analysis of secondary diffusion done.
## s potJumps Jumps Total_time
## 1 16 4243 387 7.694898 mins
## 2 40 3747 387 2.973373 mins
## 3 80 5034 387 2.109599 mins
For this dataset, all computational times are decreased by dividing
space into 40 sectors instead of 16. Data is not dense enough for
dividing space into 80 sectors, as indicated by multiple warning
messages from find_threshold
.
– end of vignette –