pf_setup_optimisers | R Documentation |
pf
This function defines optimisation settings for pf
. These settings control under-the-hood implementation routines in pf
that may improve computation time if adjusted.
pf_setup_optimisers(
use_raster_operations = TRUE,
use_calc_distance_euclid_backend_grass = FALSE,
use_grass_dir = NULL
)
use_raster_operations |
(experimental) A logical input that defines whether or not to use |
use_calc_distance_euclid_backend_grass |
A logical input that defines whether or not to use GRASS as the backend for Euclidean distances calculations in |
use_grass_dir |
If |
pf
is a computationally intensive routine. To reduce computation time, the most effective approaches are to minimise data volume and reduce the size (dimensions and/or resolution) of the grid over which particle filtering is implemented; use the ‘fast Euclidean distances’ method for distance calculations; and minimise the number of particles. For small numbers of particles, it may be faster to specify the mobility
parameter; for large numbers of particles, it is probably faster to set mobility = NULL
. Adjusting raster{rasterOptions}
such as chunksize
and/or maxmemory
may help in some circumstances too. Following optimisation of these settings, pf_setup_optimisers
facilitates the adjustment of under-the-hood implementation routines which may further reduce computation time in some settings.
The function returns pf_optimiser
S3 class object, which is simply a named list of optimisation options that can be passed to pf
via the optimisers
argument.
Edward Lavender
pf
#### Example (1): The default implementation
pf_setup_optimisers()
#### Example (2): Use GRASS for Euclidean distance calculations
# Specification for GRASS-7.4.4 on MacOS
pf_setup_optimisers(
use_calc_distance_euclid_backend_grass = TRUE,
use_grass_dir = "/Applications/GRASS-7.4.4.app/Contents/Resources"
)
# This list should be passed to the 'optimisers' argument in pf().
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.