Learn R Programming

BBEST (version 0.1-8)

do.iter: Estimate the background

Description

do.iter performs adaptive Bayesian estimation of the background.

Usage

do.iter(fit.results, local = TRUE, eps = 1e-04, 
        n.iter = 10000, save.to = "")

Arguments

fit.results

list. The return value of do.fit.

local

logical. If TRUE, gradient descent method is used to find background estimation. If FALSE, Differential Evolution is used.

eps

numeric, the desired accuracy for spline values.

n.iter

numeric, number of iterations for a gradient descent method, see details.

save.to

character, the filename for saving the results.

Value

An object fit.results with modified elements fit.results$curves$bkg, fit.results$curves$y and fit.results$curves$corr. See do.fit for details.

Details

An adaptation of neutron scattering data for a Bayesian background separation procedure. The method is detailed elsewhere*.

First, use the function do.fit to estimate the background from the low-r information in G(r). do.iter procedure estimates the background without low-r information, calculates the difference between the two estimates, subtracts this difference from the scattering data and finds the new estimate of the background.

References

*Gagin, A. and Levin, I. Hydrogen background estimation in neutron total scattering experiments. Submitted for publication.