Package specific_analyses :: Package relax_fit :: Module api :: Class Relax_fit
[hide private]
[frames] | no frames]

Class Relax_fit

source code


Class containing functions for relaxation curve fitting.

Instance Methods [hide private]
 
__init__(self)
Initialise the class by placing API_common methods into the API.
source code
numpy rank-2 array, numpy rank-2 array
covariance_matrix(self, model_info=None, verbosity=1)
Return the Jacobian and weights required for parameter errors via the covariance matrix.
source code
list of floats
create_mc_data(self, data_id=None)
Create the Monte Carlo peak intensity data.
source code
 
data_init(self, data, sim=False)
Initialise the spin specific data structures.
source code
list of str
get_param_names(self, model_info=None)
Return a vector of parameter names.
source code
list of str
get_param_values(self, model_info=None, sim_index=None)
Return a vector of parameter values.
source code
 
grid_search(self, lower=None, upper=None, inc=None, scaling_matrix=None, constraints=True, verbosity=1, sim_index=None)
The exponential curve fitting grid search method.
source code
 
minimise(self, min_algor=None, min_options=None, func_tol=None, grad_tol=None, max_iterations=None, constraints=False, scaling_matrix=None, verbosity=0, sim_index=None, lower=None, upper=None, inc=None)
Relaxation curve fitting minimisation method.
source code
 
overfit_deselect(self, data_check=True, verbose=True)
Deselect spins which have insufficient data to support minimisation.
source code
list of float
return_data(self, data_id=None)
Function for returning the peak intensity data structure.
source code
list of float
return_error(self, data_id)
Return the standard deviation data structure.
source code
 
sim_pack_data(self, data_id, sim_data)
Pack the Monte Carlo simulation data.
source code

Inherited from api_base.API_base: back_calc_ri, base_data_loop, bmrb_read, bmrb_write, calculate, constraint_algorithm, data_names, data_type, default_value, deselect, duplicate_data, eliminate, get_model_container, has_errors, is_spin_param, map_bounds, model_desc, model_loop, model_statistics, model_type, molmol_macro, num_instances, print_model_title, pymol_macro, return_conversion_factor, return_data_desc, return_error_red_chi2, return_grace_string, return_grace_units, return_units, return_value, set_error, set_param_values, set_selected_sim, set_update, sim_init_values, sim_return_chi2, sim_return_param, sim_return_selected, skip_function

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]

Inherited from api_base.API_base: __new__

Class Variables [hide private]
  instance = None
hash(x)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Initialise the class by placing API_common methods into the API.

Overrides: object.__init__

covariance_matrix(self, model_info=None, verbosity=1)

source code 

Return the Jacobian and weights required for parameter errors via the covariance matrix.

Parameters:
  • model_info (SpinContainer instance, str) - The spin container and the spin ID string from the _model_loop_spin() method.
  • verbosity (int) - The amount of information to print. The higher the value, the greater the verbosity.
Returns: numpy rank-2 array, numpy rank-2 array
The Jacobian and weight matrices for the given model.
Overrides: api_base.API_base.covariance_matrix

create_mc_data(self, data_id=None)

source code 

Create the Monte Carlo peak intensity data.

Parameters:
  • data_id (str) - The spin identification string, as yielded by the base_data_loop() generator method.
Returns: list of floats
The Monte Carlo simulation data.
Overrides: api_base.API_base.create_mc_data

data_init(self, data, sim=False)

source code 

Initialise the spin specific data structures.

Parameters:
  • data (str) - The spin ID string from the _base_data_loop_spin() method.
  • sim (bool) - The Monte Carlo simulation flag, which if true will initialise the simulation data structure.
Overrides: api_base.API_base.data_init

get_param_names(self, model_info=None)

source code 

Return a vector of parameter names.

Parameters:
  • model_info (SpinContainer instance, str) - The spin container and the spin ID string from the _model_loop_spin() method.
Returns: list of str
The vector of parameter names.
Overrides: api_base.API_base.get_param_names

get_param_values(self, model_info=None, sim_index=None)

source code 

Return a vector of parameter values.

Parameters:
  • model_info (SpinContainer instance, str) - The spin container and the spin ID string from the _model_loop_spin() method.
  • sim_index (int) - The optional Monte Carlo simulation index.
Returns: list of str
The vector of parameter values.
Overrides: api_base.API_base.get_param_values

grid_search(self, lower=None, upper=None, inc=None, scaling_matrix=None, constraints=True, verbosity=1, sim_index=None)

source code 

The exponential curve fitting grid search method.

Parameters:
  • lower (list of lists of numbers) - The per-model lower bounds of the grid search which must be equal to the number of parameters in the model.
  • upper (list of lists of numbers) - The per-model upper bounds of the grid search which must be equal to the number of parameters in the model.
  • inc (list of lists of int) - The per-model increments for each dimension of the space for the grid search. The number of elements in the array must equal to the number of parameters in the model.
  • scaling_matrix (list of numpy rank-2, float64 array or list of None) - The per-model list of diagonal and square scaling matrices.
  • constraints (bool) - If True, constraints are applied during the grid search (eliminating parts of the grid). If False, no constraints are used.
  • verbosity (int) - A flag specifying the amount of information to print. The higher the value, the greater the verbosity.
  • sim_index (int) - The index of the simulation to apply the grid search to. If None, the normal model is optimised.
Overrides: api_base.API_base.grid_search

minimise(self, min_algor=None, min_options=None, func_tol=None, grad_tol=None, max_iterations=None, constraints=False, scaling_matrix=None, verbosity=0, sim_index=None, lower=None, upper=None, inc=None)

source code 

Relaxation curve fitting minimisation method.

Parameters:
  • min_algor (str) - The minimisation algorithm to use.
  • min_options (array of str) - An array of options to be used by the minimisation algorithm.
  • func_tol (None or float) - The function tolerance which, when reached, terminates optimisation. Setting this to None turns of the check.
  • grad_tol (None or float) - The gradient tolerance which, when reached, terminates optimisation. Setting this to None turns of the check.
  • max_iterations (int) - The maximum number of iterations for the algorithm.
  • constraints (bool) - If True, constraints are used during optimisation.
  • scaling_matrix (list of numpy rank-2, float64 array or list of None) - The per-model list of diagonal and square scaling matrices.
  • verbosity (int) - The amount of information to print. The higher the value, the greater the verbosity.
  • sim_index (None or int) - The index of the simulation to optimise. This should be None if normal optimisation is desired.
  • lower (list of lists of numbers) - The per-model lower bounds of the grid search which must be equal to the number of parameters in the model. This optional argument is only used when doing a grid search.
  • upper (list of lists of numbers) - The per-model upper bounds of the grid search which must be equal to the number of parameters in the model. This optional argument is only used when doing a grid search.
  • inc (list of lists of int) - The per-model increments for each dimension of the space for the grid search. The number of elements in the array must equal to the number of parameters in the model. This argument is only used when doing a grid search.
Overrides: api_base.API_base.minimise

overfit_deselect(self, data_check=True, verbose=True)

source code 

Deselect spins which have insufficient data to support minimisation.

Parameters:
  • data_check (bool) - A flag to signal if the presence of base data is to be checked for.
  • verbose (bool) - A flag which if True will allow printouts.
Overrides: api_base.API_base.overfit_deselect

return_data(self, data_id=None)

source code 

Function for returning the peak intensity data structure.

Parameters:
  • data_id (str) - The spin identification string, as yielded by the base_data_loop() generator method.
Returns: list of float
The peak intensity data structure.
Overrides: api_base.API_base.return_data

return_error(self, data_id)

source code 

Return the standard deviation data structure.

Parameters:
  • data_id (str) - The spin identification string, as yielded by the base_data_loop() generator method.
Returns: list of float
The standard deviation data structure.
Overrides: api_base.API_base.return_error

sim_pack_data(self, data_id, sim_data)

source code 

Pack the Monte Carlo simulation data.

Parameters:
  • data_id (str) - The spin identification string, as yielded by the base_data_loop() generator method.
  • sim_data (list of float) - The Monte Carlo simulation data.
Overrides: api_base.API_base.sim_pack_data