Trees  Indices  Help 



Class containing the target function of the optimisation of the Nstate model.




float 


float 


numpy rank1 array 


numpy rank2 array 




Set up the class instance for optimisation. The Nstate modelsAll constant data required for the Nstate model are initialised here. Depending on the base data used for optimisation, different data structures can be supplied. However a number of structures must be provided for the Nstate model. These are:
2domain Nstate modelIf the model type is set to '2domain', then the following data structures should be supplied:
The population Nstate modelIn this model, populations are optimised for each state. Additionally the alignment tensors for anisotropic data can also be optimised if they have not been supplied (through the full_tensors arg). PCS base dataIf pseudocontact shift data is to be used for optimisation, then the following should be supplied:
PCS and PRE base dataIf either pseudocontact shift or PRE data is to be used for optimisation, then the following should be supplied:
RDC base dataIf residual dipolar coupling data is to be used for optimisation, then the following should be supplied:

The target function for optimisation of the 2domain Nstate model. This function should be passed to the optimisation algorithm. It accepts, as an array, a vector of parameter values and, using these, returns the single chisquared value corresponding to that coordinate in the parameter space. If no tensor errors are supplied, then the SSE (the sum of squares error) value is returned instead. The chisquared is simply the SSE normalised to unit variance (the SSE divided by the error squared).

The target function for optimisation of the standard Nstate model. DescriptionThis function should be passed to the optimisation algorithm. It accepts, as an array, a vector of parameter values and, using these, returns the single chisquared value corresponding to that coordinate in the parameter space. If no RDC or PCS errors errors are supplied, then the SSE (the sum of squares error) value is returned instead. The chisquared is simply the SSE normalised to unit variance (the SSE divided by the error squared). IndicesFor this calculation, five indices are looped over and used in the various data structures. These include:
EquationsTo calculate the function value, a chain of equations are used. This includes the chisquared equation and the RDC and PCS equations. The chisquared equationThe equations are: ___ \ (Dij  Dij(theta)) ** 2 chi^2(theta) = >  , /__ sigma_ij ** 2 ij ___ \ (delta_ij  delta_ij(theta)) ** 2 chi^2(theta) = >  , /__ sigma_ij ** 2 ij where:
Both chisquared values sum. The RDC equationThe RDC equation is: _N_ \ T Dij(theta) = dj > pc . mu_jc . Ai . mu_jc, /__ c=1 where:
In the fixed and equal probability case, the equation is: _N_ dj \ T Dij(theta) =  > mu_jc . Ai . mu_jc, N /__ c=1 The dipolar constant is henceforth defined as: dj = 3 / (2pi) d', where the factor of 2pi is to convert from units of rad.s^1 to Hertz, the factor of 3 is associated with the alignment tensor and the pure dipolar constant in SI units is: mu0 gI.gS.h_bar d' =    , 4pi r**3 where:
The PCS equationThe PCS equation is: _N_ \ T delta_ij(theta) = > pc . dijc . mu_jc . Ai . mu_jc, /__ c=1 where:
In the fixed and equal probability case, the equation is: _N_ 1 \ T delta_ij(theta) =  > dijc . mu_jc . Ai . mu_jc, N /__ c=1 The PCS constant is defined as: mu0 15kT 1 dijc =    , 4pi Bo**2 r**3 where:
Stored data structuresThere are a number of data structures calculated by this function and stored for subsequent use in the gradient and Hessian functions. This include the back calculated RDCs and PCSs and the alignment tensors. Dij(theta)The back calculated RDCs. This is a rank2 tensor with indices {i, j}. delta_ij(theta)The back calculated PCS. This is a rank2 tensor with indices {i, j}. AiThe alignment tensors. This is a rank3 tensor with indices {i, n, m}.

The gradient function for optimisation of the standard Nstate model. DescriptionThis function should be passed to the optimisation algorithm. It accepts, as an array, a vector of parameter values and, using these, returns the chisquared gradient corresponding to that coordinate in the parameter space. If no RDC or PCS errors are supplied, then the SSE (the sum of squares error) gradient is returned instead. The chisquared gradient is simply the SSE gradient normalised to unit variance (the SSE divided by the error squared). IndicesFor this calculation, six indices are looped over and used in the various data structures. These include:
EquationsTo calculate the chisquared gradient, a chain of equations are used. This includes the chisquared gradient, the RDC gradient and the alignment tensor gradient. The chisquared gradientThe equation is: ___ dchi^2(theta) \ / Dij  Dij(theta) dDij(theta) \  = 2 >   .   dthetak /__ \ sigma_ij**2 dthetak / ij where:
The RDC gradientThis gradient is different for the various parameter types. pc partial derivativeThe population parameter partial derivative is: dDij(theta) T  = dj . mu_jc . Ai . mu_jc, dpc where:
Amn partial derivativeThe alignment tensor element partial derivative is: _N_ dDij(theta) \ T dAi  = dj > pc . mu_jc .  . mu_jc, dAmn /__ dAmn c=1 where:
In the case of fixed and equal populations, the equation is: _N_ dDij(theta) dj \ T dAi  =  > mu_jc .  . mu_jc, dAmn N /__ dAmn c=1 The PCS gradientThis gradient is also different for the various parameter types. pc partial derivativeThe population parameter partial derivative is: ddeltaij(theta) T  = dijc . mu_jc . Ai . mu_jc, dpc where:
Amn partial derivativeThe alignment tensor element partial derivative is: _N_ ddelta_ij(theta) \ T dAi  = > pc . djc . mu_jc .  . mu_jc, dAmn /__ dAmn c=1 where:
In the case of fixed and equal populations, the equation is: _N_ ddelta_ij(theta) 1 \ T dAi  =  > djc . mu_jc .  . mu_jc, dAmn N /__ dAmn c=1 xi partial derivativeThe paramagnetic position partial derivative is: _N_ ddelta_ij(theta) \ / ddjc dr_jcT dr_jc \  = > pc .  .r_jcT.Ai.r_jc + djc..Ai.r_jc + djc.r_jcT.Ai.  , dxi /__ \ dxi dxi dxi / c=1 where xi are the paramagnetic position coordinates {x0, x1, x2} and the last two terms in the sum are equal due to the symmetry of the alignment tensor, and: ddjc mu0 15kT 5 (si  xi)  =    , dxi 4pi Bo**2 ((sxx0)**2 + (syx1)**2 + (szx2)**2)**(7/2) and: dr  1  dr  0  dr  0   =   0  ,  =   1  ,  =   0  . dx  0  dy  0  dy  1  The pseudocontact shift constant is defined here as: mu0 15kT 1 djc =    , 4pi Bo**2 rjc**5 The alignment tensor gradientThe five unique elements of the tensor {Axx, Ayy, Axy, Axz, Ayz} give five different partial derivatives. These are: dAi  1 0 0   =  0 0 0 , dAxx  0 0 1  dAi  0 0 0   =  0 1 0 , dAyy  0 0 1  dAi  0 1 0   =  1 0 0 , dAxy  0 0 0  dAi  0 0 1   =  0 0 0 , dAxz  1 0 0  dAi  0 0 0   =  0 0 1 . dAyz  0 1 0  As these are invariant, they can be precalculated. Stored data structuresThere are a number of data structures calculated by this function and stored for subsequent use in the Hessian function. This include the back calculated RDC and PCS gradients and the alignment tensor gradients. dDij(theta)/dthetakThe back calculated RDC gradient. This is a rank3 tensor with indices {k, i, j}. ddeltaij(theta)/dthetakThe back calculated PCS gradient. This is a rank3 tensor with indices {k, i, j}. dAi/dAmnThe alignment tensor gradients. This is a rank3 tensor with indices {5, n, m}.

The Hessian function for optimisation of the standard Nstate model. DescriptionThis function should be passed to the optimisation algorithm. It accepts, as an array, a vector of parameter values and, using these, returns the chisquared Hessian corresponding to that coordinate in the parameter space. If no RDC/PCS errors are supplied, then the SSE (the sum of squares error) Hessian is returned instead. The chisquared Hessian is simply the SSE Hessian normalised to unit variance (the SSE divided by the error squared). IndicesFor this calculation, six indices are looped over and used in the various data structures. These include:
EquationsTo calculate the chisquared gradient, a chain of equations are used. This includes the chisquared gradient, the RDC gradient and the alignment tensor gradient. The chisquared HessianThe equation is: ___ d2chi^2(theta) \ 1 / dDij(theta) dDij(theta) d2Dij(theta) \  = 2 >    .   (DijDij(theta)) .  . dthetaj.dthetak /__ sigma_i**2 \ dthetaj dthetak dthetaj.dthetak / ij where:
The RDC Hessianpcpd second partial derivativesThe probability parameter second partial derivative is: d2Dij(theta)  = 0. dpc.dpd pcAnm second partial derivativesThe probability parametertensor element second partial derivative is: d2Dij(theta) T dAi  = dj . mu_jc .  . mu_jc. dpc.dAmn dAmn AmnAop second partial derivativesThe alignment tensor element second partial derivative is: d2Dij(theta)  = 0. dAmn.dAop The PCS Hessianpcpd second partial derivativesThe probability parameter second partial derivative is: d2delta_ij(theta)  = 0. dpc.dpd pcAnm second partial derivativesThe probability parametertensor element second partial derivative is: d2delta_ij(theta) T dAi  = djc . mu_jc .  . mu_jc. dpc.dAmn dAmn AmnAop second partial derivativesThe alignment tensor element second partial derivative is: d2delta_ij(theta)  = 0 dAmn.dAop The alignment tensor HessianThe five unique elements of the tensor {Axx, Ayy, Axy, Axz, Ayz} all have the same second partial derivative of: d2Ai  0 0 0   =  0 0 0 . dAmn.dAop  0 0 0 

Trees  Indices  Help 


Generated by Epydoc 3.0.1 on Fri Jun 14 11:29:49 2019  http://epydoc.sourceforge.net 