1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """The error_analysis user function definitions."""
24
25
26 from os import sep
27
28
29 from graphics import ANALYSIS_IMAGE_PATH
30 from pipe_control.error_analysis import covariance_matrix
31 from user_functions.data import Uf_info; uf_info = Uf_info()
32 from user_functions.objects import Desc_container
33
34
35
36 uf_class = uf_info.add_class('error_analysis')
37 uf_class.title = "Class for relaxation curve fitting."
38 uf_class.menu_text = "&error_analysis"
39
40
41
42 uf = uf_info.add_uf('error_analysis.covariance_matrix')
43 uf.title = "Parameter error estimation via the covariance matrix."
44 uf.title_short = "Covariance matrix parameter error estimation."
45 uf.add_keyarg(
46 name = "epsrel",
47 py_type = "float",
48 default = 0.0,
49 desc_short = "parameter to remove linear-dependent columns.",
50 desc = "The parameter to remove linear-dependent columns when J is rank deficient.",
51 can_be_none = False
52 )
53 uf.add_keyarg(
54 name = "verbosity",
55 default = 1,
56 py_type = "int",
57 desc_short = "amount of information to print.",
58 desc = "The higher the value, the greater the verbosity.",
59 can_be_none = False
60 )
61
62 uf.desc.append(Desc_container())
63 uf.desc[-1].add_paragraph("This is a new experimental feature from version 3.3.")
64 uf.desc[-1].add_paragraph("This will estimate parameter errors by using the exponential decay Jacobian matrix 'J' to compute the covariance matrix of the best-fit parameters.")
65 uf.desc[-1].add_paragraph("This can be used to for comparison to Monte-Carlo simulations.")
66 uf.desc[-1].add_paragraph("This method is inspired from the GNU Scientific Library (GSL).")
67 uf.desc[-1].add_paragraph("The covariance matrix is given by: covar = Qxx = (J^T.W.J)^-1, where the weight matrix W is constructed by the multiplication of an Identity matrix I and a weight array w. The weight array is 1/errors^2, which then gives W = I.w = I x 1/errors^2.")
68 uf.desc[-1].add_paragraph("Qxx is computed by QR decomposition, J^T.W.J=QR, Qxx=R^-1. Q^T. The columns of R which satisfy: |R_{kk}| <= epsrel |R_{11}| are considered linearly-dependent and are excluded from the covariance matrix (the corresponding rows and columns of the covariance matrix are set to zero).")
69 uf.desc[-1].add_paragraph("The parameter 'epsrel' is used to remove linear-dependent columns when J is rank deficient.")
70 uf.backend = covariance_matrix
71 uf.menu_text = "&covariance_matrix"
72 uf.wizard_size = (800, 800)
73 uf.wizard_image = ANALYSIS_IMAGE_PATH + sep + 'blank_150x150.png'
74