1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 """The error_analysis user function definitions."""
26
27
28 from os import sep
29
30
31 from graphics import ANALYSIS_IMAGE_PATH
32 from pipe_control.error_analysis import covariance_matrix
33 from user_functions.data import Uf_info; uf_info = Uf_info()
34 from user_functions.objects import Desc_container
35
36
37
38 uf_class = uf_info.add_class('error_analysis')
39 uf_class.title = "Class for relaxation curve fitting."
40 uf_class.menu_text = "&error_analysis"
41
42
43
44 uf = uf_info.add_uf('error_analysis.covariance_matrix')
45 uf.title = "Parameter error estimation via the covariance matrix."
46 uf.title_short = "Covariance matrix parameter error estimation."
47 uf.add_keyarg(
48 name = "epsrel",
49 basic_types = ["float"],
50 default = 0.0,
51 desc_short = "parameter to remove linear-dependent columns.",
52 desc = "The parameter to remove linear-dependent columns when J is rank deficient.",
53 can_be_none = False
54 )
55 uf.add_keyarg(
56 name = "verbosity",
57 default = 1,
58 basic_types = ["int"],
59 desc_short = "amount of information to print.",
60 desc = "The higher the value, the greater the verbosity.",
61 can_be_none = False
62 )
63
64 uf.desc.append(Desc_container())
65 uf.desc[-1].add_paragraph("This is a new experimental feature from version 3.3.")
66 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.")
67 uf.desc[-1].add_paragraph("This can be used to for comparison to Monte-Carlo simulations.")
68 uf.desc[-1].add_paragraph("This method is inspired from the GNU Scientific Library (GSL).")
69 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.")
70 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).")
71 uf.desc[-1].add_paragraph("The parameter 'epsrel' is used to remove linear-dependent columns when J is rank deficient.")
72 uf.backend = covariance_matrix
73 uf.menu_text = "&covariance_matrix"
74 uf.wizard_size = (800, 800)
75 uf.wizard_image = ANALYSIS_IMAGE_PATH + sep + 'blank_150x150.png'
76