improveSynth: Check (and Improve) Results of Package Synth

View source: R/improveSynth.r

improveSynthR Documentation

Check (and Improve) Results of Package Synth

Description

improveSynth checks the results of synth for feasibility and optimality and tries to find a better solution.

Usage

improveSynth(
  synth.out,
  dataprep.out,
  lb = 1e-08,
  tol = 1e-05,
  verbose = TRUE,
  seed = 1,
  ...
)

Arguments

synth.out

A result of synth from package 'Synth'.

dataprep.out

The input of function synth which led to synth.out.

lb

A numerical scalar (default: 1e-8), corresponding to the lower bound for the outer optimization.

tol

A numerical scalar (default: 1e-5). If the relative *and* absolute improvement of loss.v and loss.w, respectively, exceed tol, this is reported (if verbose is TRUE). Better optima are always looked for (independent of the value of tol).

verbose

A logical scalar. Should the ouput be verbose (defaults to TRUE).

seed

A numerical vector or NULL. See the corresponding documentation for mscmt. Defaults to 1 in order to provide reproducibility of the results.

...

Further arguments to mscmt. Supported arguments are check.global, inner.optim, inner.opar, outer.optim, and outer.opar.

Details

Performing SCM means solving a nested optimization problem. Depending on the validity of the results of the inner optimization, SCM may produce

  • invalid or infeasible results, if the vector w of donor weights reported as the result of the inner optimization is in fact not optimal, ie. produces too large loss.w,

  • suboptimal results, if the vector v of predictor weights reported as the result of the outer optimization is in fact not optimal (which may be caused by shortcomings of the inner optimization).

improveSynth first checks synth.out for feasibility and then tries to find a feasible and optimal solution by applying the optimization methods of package MSCMT to dataprep.out (with default settings, more flexibility will probably be added in a future release).

Value

An updated version of synth.out, where solution.v, solution.w, loss.v, and loss.w are replaced by the optimum obtained by package 'MSCMT' and all other components of synth.out are removed.

Examples

## Not run: 
## example has been removed because package 'Synth' has been archived
## See vignette 'Checking and Improving Results of package Synth'
## for an example working with a cached copy

## End(Not run)

MSCMT documentation built on Nov. 13, 2023, 5:07 p.m.