@@ -82,10 +82,12 @@ def setcovariance(self, model, cov):
82
82
83
83
Parameters
84
84
----------
85
- model - A ModelParts object
86
- cov - The nxn covariance matrix for n model parameters. If the parameterization includes "fixed"
87
- parameters not included in the covariance matrix, the matrix is expanded to include these
88
- parameters with 0 uncertainty.
85
+ model : ModelParts
86
+ The ModelParts instance
87
+ cov : ndarray
88
+ The nxn covariance matrix for n model parameters. If the parameterization includes "fixed"
89
+ parameters not included in the covariance matrix, the matrix is expanded to include these
90
+ parameters with 0 uncertainty.
89
91
"""
90
92
tempcov = np .array (cov )
91
93
@@ -151,8 +153,10 @@ def transform(self, in_format, out_format, **kwds):
151
153
152
154
Parameters
153
155
----------
154
- in_format - The current format of parameters
155
- out_format - The new format for parameters
156
+ in_format : str
157
+ The current format of parameters
158
+ out_format : str
159
+ The new format for parameters
156
160
157
161
Keywords
158
162
--------
@@ -229,6 +233,18 @@ def getcorrelation(self, i, j):
229
233
230
234
The standard deviation of fixed parameters is 0, in which case the correlation is
231
235
undefined, but return 0 for simplicity.
236
+
237
+ Parameters
238
+ ----------
239
+ i : int
240
+ The index of variable in peak mapping
241
+ j : int
242
+ The index of variable in peak mapping
243
+
244
+ Returns
245
+ -------
246
+ float
247
+ The correlation between variables i and j
232
248
"""
233
249
if self .cov is None :
234
250
emsg = "Cannot get correlation on undefined covariance matrix."
@@ -257,6 +273,16 @@ def getuncertainty(self, i):
257
273
258
274
The variable may be specified as an integer, or as a two-component tuple of integers (l, m)
259
275
which indicate the mth parameter of modelpart l.
276
+
277
+ Parameters
278
+ ----------
279
+ i : int
280
+ The index of variable in peak mapping
281
+
282
+ Returns
283
+ -------
284
+ float
285
+ The uncertainty of variable at index i.
260
286
"""
261
287
(l , m ) = i if i in self .pmap else self .ipmap [i ]
262
288
return np .sqrt (self .getcovariance (i , i ))
@@ -266,6 +292,18 @@ def getcovariance(self, i, j):
266
292
267
293
The variables may be specified as integers, or as a two-component tuple of integers (l, m)
268
294
which indicate the mth parameter of modelpart l.
295
+
296
+ Parameters
297
+ ----------
298
+ i : int
299
+ The index of variable in peak mapping
300
+ j : int
301
+ The index of variable in peak mapping
302
+
303
+ Returns
304
+ -------
305
+ float
306
+ The covariance between variables at indeex i and j.
269
307
"""
270
308
if self .cov is None :
271
309
emsg = "Cannot get correlation on undefined covariance matrix."
@@ -282,6 +320,16 @@ def get(self, i):
282
320
283
321
The variable may be specified as an integer, or as a two-component tuple of integers (l, m)
284
322
which indicate the mth parameter of modelpart l.
323
+
324
+ Parameters
325
+ ----------
326
+ i : int
327
+ The index of variable in peak mapping
328
+
329
+ Returns
330
+ -------
331
+ (float, float)
332
+ The value and uncertainty of variable at index i.
285
333
"""
286
334
return (self .getvalue (i ), self .getuncertainty (i ))
287
335
@@ -294,8 +342,13 @@ def correlationwarning(self, threshold=0.8):
294
342
295
343
Parameters
296
344
----------
297
- threshold - A real number between 0 and 1.
345
+ threshold : float
346
+ A real number between 0 and 1.
298
347
348
+ Returns
349
+ -------
350
+ tuple (i, j, c)
351
+ Indices of the modelpart and their correlations.
299
352
"""
300
353
if self .cov is None :
301
354
emsg = "Cannot calculate correlation on undefined covariance matrix."
@@ -323,6 +376,16 @@ def prettypar(self, i):
323
376
324
377
The variable may be specified as an integer, or as a two-component tuple of integers (l, m)
325
378
which indicate the mth parameter of modelpart l.
379
+
380
+ Parameters
381
+ ----------
382
+ i : int
383
+ The index of variable in peak mapping
384
+
385
+ Returns
386
+ -------
387
+ str
388
+ 'value (uncertainty)' for variable at index i.
326
389
"""
327
390
if self .model is None or self .cov is None :
328
391
return "Model and/or Covariance matrix undefined."
0 commit comments