do.fit
estimates the background using the Bayesian approach and Differential Evolution algorithm.
do.fit(data, bounds.lower, bounds.upper, scale=c(1,1), knots.x=NA,
knots.n=NA, analytical=FALSE, stdev=TRUE, control=list(), p.bkg=.5,
save.to="")
an object of type data
. See set.data
for details.
numerics specifying the lower and upper bounds for the fitted spline values.
numeric vector which, if applicable, determines the bounds for the fitted scale parameter. The default value of c(1,1)
means a no-scale fit. See details.
numeric vector which, if not NA
, specifies the knot positions.
numeric, the number of knots. If knots.x
is NA
then knots.n
equidistant knots will be created.
logical. If TRUE
background is approximated by an analytical function \(f(x)=P_1\exp(-P_2x)x^{P_3} + P_4/[(x-P_5)^2+P_6^2]\).
logical, whether to calculate the uncertainty for the estimated background. Should be set to FALSE
if analytical=TRUE
.
list, the return value of set.control
. Specifies various parameters of the Differential Evolution optimization algorithm implemented in DEoptim
.
numeric, the probability that a single pixel contains "only" a background.
character, a filename for saving the results.
A list with elements:
numeric vector of grid points
list, see below.
list, see below.
list with elements x
and y
that specify the positions of the knots and the corresponding fitted intensity values, respectively.
numeric vector. If the background is approximated using the analytical function, contains all the relevant parameters P
.
fitted value of the scale
parameter, if used.
fitted values of the atomic displacement parameters, if applicable.
list, see below.
Element curves is a list with sub-elements:
numeric vector of the (normalized) function values.
numeric vector, the estimated background.
numeric vector, the (fitted) coherent baseline.
Element uncrt is a list with sub-elements:
numeric vector, indicates estimated standard deviations for the reconstructed signal.
numeric vector, indicates estimated standard deviations for a reconstructed signal in r-space.
Hessian matrix for a \(\psi(c)\) function.
covariance matrix, i.e. the inverse of the Hessian.
covariance matrix in r-space.
Element fit.details is a list with sub-elements:
numeric vector, the estimated mean magnitude of the signal.
numeric vector, the estimated Gaussian noise.
the number of knots used in the fit.
knot positions used in the fit.
see the control
argument.
list contacting information on the low-r behaviour of G(r) . See set.Gr
for details.
numeric vector, number of different atoms per unit cell.
numeric vector, atomic scattering factors.
If information on the low-r behavior of G(r) is provided, the global intensity scale and atomic displacement parameters can be fitted along with the positions of the knots, (set.Gr
). To fit normalization parameter set bounds in scale
for the desired values. To fit Atomic Displacement Parameters see set.SB
.
In most cases p.bkg
should be set to its default value 0.5.
For further details see BBEST-package
.
Ardia, D., Mullen, K., Peterson, B. & Ulrich, J. (2011): DEoptim. R Package Version 2.2-2. https://CRAN.R-project.org/package=DEoptim.
Mullen, K.M., Ardia, D., Gil, D., Windover, D., Cline, J. (2011): DEoptim: An R Package for Global Optimization by Differential Evolution. J. Stat. Softw., 40(6), 1-26. https://www.jstatsoft.org/article/view/v040i06.