Inversion with automatic convergence checking
Usage
invert.auto(
observed,
invert.options,
return.samples = TRUE,
save.samples = NULL,
quiet = FALSE,
parallel = TRUE,
parallel.cores = NULL,
parallel.output = "/dev/null"
)Arguments
- observed
Vector, matrix, or data frame (coerced to matrix) of observed values. For spectral data, wavelengths are rows and spectra are columns. Dimensions must align with the output of
model.- invert.options
Parameters related to inversion.
- return.samples
Include full samples list in output. Default =
TRUE.- save.samples
Save samples to file as the inversion proceeds (useful for debugging). If
NULL, do not save samples. Default =NULL.- quiet
Suppress progress bar and status messages. Default=FALSE
- parallel
Logical. Whether or not to run multiple chains in parallel on multiple cores (default =
TRUE).- parallel.cores
Number of cores to use for parallelization. If
NULL(default), allocate one fewer than detected number of cores.- parallel.output
Filename (or ” for stdout) for printing parallel outputs. Use with caution. Default =
'/dev/null'.
Value
List including results (summary statistics), samples
(mcmc.list object, or NA if return.samples=FALSE), and other
information.
Details
Performs an inversion via the invert.custom function with
multiple chains and automatic convergence checking. Convergence checks are
performed using the multivariate Gelman-Rubin diagnostic.
Parameters specific to invert.auto are described here.
For the remaining parameters, see invert.custom().
model– The model to be inverted. This should be an R function that takesparamsas input and returns one column ofobserved(nrows should be the same). Constants should be implicitly included here.nchains– Number of independent chains.inits.function– Function for generating initial conditions.ngibbs.max– Maximum number of total iterations (per chain). DEFAULT = 5e6ngibbs.min– Minimum number of total iterations (per chain). DEFAULT = 5000.ngibbs.step– Number of iterations between convergence checks. Default = 1000.run_first– Function to run before running sampling. Takes parallel inputs list containing runID, initial values, and resume (NULL) as an argument.calculate.burnin– IfTRUE, usePEcAn.assim.batch::autoburninfunction to calculate burnin. Otherwise, assume burnin ismin(niter/2, iter_conv_check).threshold– Maximum value of the Gelman-Rubin diagnostic for determining convergence. Default = 1.1