View source: R/optimization_functions.R
optimization_heuristic | R Documentation |
This function implements a greedy optimization heuristic. At each step, we compute the expected posterior value of the objective function after allocating the particle to each node. We then assign the particle to the site with the lowest of these values.
optimization_heuristic(alphas, n, obj_fn, obj_fn_args, block_size = 1)
alphas |
The matrix alpha as described in the manuscript text. |
n |
The number of new tracers to allocate. |
obj_fn |
The objective function to optimize over. |
obj_fn_args |
Arguments to pass to the objective function. |
block_size |
An optional number of tracers to allocate as a single block. The algorithm is approximately linear with respect to the number of blocks, so setting a block size greater than 1 can be useful for reducing runtime with very large number of tracers. |
A list with the release distribution (dist) and the expected posterior cost from using this distribution (cost).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.