optimization_heuristic: This function implements a greedy optimization heuristic. At...

View source: R/optimization_functions.R

optimization_heuristicR 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.

Description

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.

Usage

optimization_heuristic(alphas, n, obj_fn, obj_fn_args, block_size = 1)

Arguments

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.

Value

A list with the release distribution (dist) and the expected posterior cost from using this distribution (cost).


btjones16/sequential-analysis-software documentation built on Feb. 21, 2024, 2:23 p.m.