directional_proposal: Emulated Derivative Point Proposal

View source: R/derivative_functions.R

directional_proposalR Documentation

Emulated Derivative Point Proposal

Description

Proposes a new point by applying ‘emulated gradient descent’ on an existing point.

Usage

directional_proposal(
  ems,
  x,
  targets,
  accept = 2,
  hstart = 1e-04,
  hcutoff = 1e-09,
  iteration.measure = "exp",
  iteration.steps = 100,
  nv = 500
)

Arguments

ems

The emulators to evaluate with respect to.

x

The original point.

targets

The list of emulator targets.

accept

The implausibility below which we allow an output to worsen.

hstart

The initial step size.

hcutoff

The minimum allowed step size.

iteration.measure

Either ‘exp’ for expectation or ‘imp’ for implausibility.

iteration.steps

The number of allowed iterations.

nv

The number of directions on the n-sphere to try.

Details

Given a point (preferably close to the implausibility boundary) x, we can calculate the emulated gradient at this point for each emulator. If the estimate of the expectation at this point for a given emulator is larger than the target value, then we would like to move in the direction of greatest decrease for this emulator, and conversely for an estimate of the expectation that's smaller than the target value. The combination of this information for every emulator under consideration defines a preferred set of directions of travel from this point.

We may try to find a shared direction which improves (or at least does not worsen) all emulator evaluations. If a point is already well inside the implausibility boundary for a given output (where ‘well inside’ is defined by the value of accept), we may allow this output to worsen in order to improve the others.

Provided a shared direction, v, can be identified, we iteratively move in this direction. Define the new proposed point x' = x + h*v, where h is a step-size given by hstart. Compare the summary statistic (either expectational difference or implausibility) to that provided by the original point; if the new point gives improvement, then continue to move in this direction until no further improvement is possible for this step-size. The step-size is reduced (up to a minimum of hcutoff) and the process is repeated. Only finitely many iteration steps are permitted; this can be tuned by supplying a value of iteration.steps.

Value

Either a new proposal point, or the original point if an improvement could not be found.

Examples

 # Take a point from the SIR system at later waves with low (but >3) implausibility
 start_point <- SIRMultiWaveData[[2]][90,1:3]
 ems <- SIRMultiWaveEmulators[[3]]
 targs <- SIREmulators$targets
 # Using expected error as measure
 new_point1 <- directional_proposal(ems, start_point, targs, iteration.steps = 50,
  nv = 100)
 # Using implausibility as measure
 new_point2 <- directional_proposal(ems, start_point, targs, iteration.measure = 'imp',
  iteration.steps = 50, nv = 100)
 all_points <- do.call('rbind.data.frame', list(start_point, new_point1, new_point2))
 nth_implausible(ems, all_points, targs)


hmer documentation built on June 22, 2024, 9:22 a.m.