Package specific_analyses :: Package relax_disp :: Module estimate_r2eff
[hide private]
[frames] | no frames]

Module estimate_r2eff

source code

Target functions for relaxation exponential curve fitting with both minfx and scipy.optimize.leastsq.

Classes [hide private]
  Exp
Functions [hide private]
 
estimate_r2eff_err(spin_id=None, epsrel=0.0, verbosity=1)
This will estimate the R2eff and i0 errors from the covariance matrix Qxx.
source code
 
estimate_r2eff(method='minfx', min_algor='simplex', c_code=True, constraints=False, chi2_jacobian=False, spin_id=None, ftol=1e-15, xtol=1e-15, maxfev=10000000, factor=100.0, verbosity=1)
Estimate r2eff and errors by exponential curve fitting with scipy.optimize.leastsq or minfx.
source code
list
minimise_leastsq(E=None)
Estimate r2eff and errors by exponential curve fitting with scipy.optimize.leastsq.
source code
list
minimise_minfx(E=None)
Estimate r2eff and errors by minimising with minfx.
source code
Variables [hide private]
  __package__ = 'specific_analyses.relax_disp'

Imports: deepcopy, array, asarray, diag, exp, log, ones, sqrt, sum, transpose, zeros, generic_minimise, sys, warn, C_module_exp_fn, scipy_module, MODEL_R2EFF, RelaxError, multifit_covar, subsection, RelaxWarning, generate_spin_string, spin_loop, check_model_type, average_intensity, loop_exp_frq_offset_point, loop_time, return_param_key_from_data, disassemble_param_vector, chi2_rankN, dchi2, Relax_fit_opt, leastsq


Function Details [hide private]

estimate_r2eff_err(spin_id=None, epsrel=0.0, verbosity=1)

source code 

This will estimate the R2eff and i0 errors from the covariance matrix Qxx. Qxx is calculated from the Jacobian matrix and the optimised parameters.

Parameters:
  • spin_id (str) - The spin identification string.
  • epsrel (float) - Any columns of R which satisfy |R_{kk}| <= epsrel |R_{11}| are considered linearly-dependent and are excluded from the covariance matrix, where the corresponding rows and columns of the covariance matrix are set to zero.
  • verbosity (int) - The amount of information to print. The higher the value, the greater the verbosity.

estimate_r2eff(method='minfx', min_algor='simplex', c_code=True, constraints=False, chi2_jacobian=False, spin_id=None, ftol=1e-15, xtol=1e-15, maxfev=10000000, factor=100.0, verbosity=1)

source code 

Estimate r2eff and errors by exponential curve fitting with scipy.optimize.leastsq or minfx.

THIS IS ONLY FOR TESTING.

scipy.optimize.leastsq is a wrapper around MINPACK's lmdif and lmder algorithms.

MINPACK is a FORTRAN90 library which solves systems of nonlinear equations, or carries out the least squares minimization of the residual of a set of linear or nonlinear equations.

Errors are calculated by taking the square root of the reported co-variance.

This can be an huge time saving step, when performing model fitting in R1rho. Errors of R2eff values, are normally estimated by time-consuming Monte-Carlo simulations.

Initial guess for the starting parameter x0 = [r2eff_est, i0_est], is by converting the exponential curve to a linear problem. Then solving initial guess by linear least squares of: ln(Intensity[j]) = ln(i0) - time[j]* r2eff.

Parameters:
  • method (string) - The method to minimise and estimate errors. Options are: 'minfx' or 'scipy.optimize.leastsq'.
  • min_algor (string) - The minimisation algorithm
  • c_code (bool) - If optimise with C code.
  • constraints (bool) - If constraints should be used.
  • chi2_jacobian (bool) - If the chi2 Jacobian should be used.
  • spin_id (str) - The spin identification string.
  • ftol (float) - The function tolerance for the relative error desired in the sum of squares, parsed to leastsq.
  • xtol (float) - The error tolerance for the relative error desired in the approximate solution, parsed to leastsq.
  • maxfev (int) - The maximum number of function evaluations, parsed to leastsq. If zero, then 100*(N+1) is the maximum function calls. N is the number of elements in x0=[r2eff, i0].
  • factor (float) - The initial step bound, parsed to leastsq. It determines the initial step bound (''factor * || diag * x||''). Should be in the interval (0.1, 100).
  • verbosity (int) - The amount of information to print. The higher the value, the greater the verbosity.

minimise_leastsq(E=None)

source code 

Estimate r2eff and errors by exponential curve fitting with scipy.optimize.leastsq.

Parameters:
  • E (class) - The Exponential function class, which contain data and functions.
Returns: list
Packed list with optimised parameter, estimated parameter error, chi2, iter_count, f_count, g_count, h_count, warning

minimise_minfx(E=None)

source code 

Estimate r2eff and errors by minimising with minfx.

Parameters:
  • E (class) - The Exponential function class, which contain data and functions.
Returns: list
Packed list with optimised parameter, parameter error set to 'inf', chi2, iter_count, f_count, g_count, h_count, warning