simulate_ts | R Documentation |
Simulate target strength (TS) with flexible parameterization and batching
simulate_ts(
object,
frequency,
model,
n_realizations,
parameters,
batch_by = NULL,
parallel = TRUE,
n_cores = parallel::detectCores() - 1,
verbose = TRUE
)
object |
Scatterer-class object. |
frequency |
Frequency (Hz). |
model |
Model name. If multiple models are specified, the output will be a list of data frames, one for each model. |
n_realizations |
Number of realizations and output TS values. |
parameters |
List containing the values, distributions, or generating functions of parameter values that inform the TS model. |
batch_by |
Optional. Specifies which parameters in |
parallel |
Logical; whether to parallelize the simulations. Default is
|
n_cores |
Optional. Number of CPU cores to use for parallelization.
Default is |
verbose |
Logical; whether to print progress and status messages to the
console. Default is |
For example, if batch_by = "length"
and parameters["length"]
is a vector of values, simulations will be run for each value of length
n_realizations
times. If multiple parameters are specified in
batch_by
, batching will occur over all combinations of their values.
A data frame (or list of data frames) with simulation results.
This function uses pbapply::pblapply()
for parallelized simulation
with progress bars. On Windows, parallelization uses PSOCK clusters, which
require all necessary objects and packages to be exported to worker
processes. On Unix-like systems, forking is used, which is generally simpler.
WARNING: Including too many parameters from parameters
within batch_by
may cause significant performance issues or cause
R
to crash. If intensive simulations are required, consider breaking
them into more manageable chunks
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.