Dispense
Navigation
Tips - Dritte
PmWiki
pmwiki.org
edit SideBar
|
< Mujpy.GlobalFits | Index | Different ways of parameter indexing >
Fit types.
|
Single group len(groups)==1
|
Multi group sequential len(groups)>1
|
Multi group global "userpardicts_guess" in keys()
|
Suite types
|
Fixed α
|
Calib
|
Fixed α
|
Calib
|
Fixed α
|
Calib
|
Single run, detected by suite
|
A1 "model_guess"
|
A1-calib "mode_guess" includes "al"
|
A20 "model_guess"
|
A20-calib "mode_guess" includes "al"
|
A21 "userpardicts_guess" "function_multi"
|
A21-calib
"userpardicts_guess" "function_multi" ""model_guess" includes "al"
|
Multi run sequential (see dashboard)
|
B1
|
-
|
-
|
-
|
B2
|
-
|
Multi run global (see dashboard)
|
C1
|
-
|
-
|
-
|
C2
|
-
|
|
Types of fit, description
with examples. {$ \checkmark$} means already implemented type. The links provide a more detailed description of the code.
- Single run, one group (A1){$ \checkmark$}. This fit has a calibrations version (A1-calib){$ \checkmark$} that fits α reconstructing asymmetry at each fit iteration (in mucomonents)
- Sequential runs, (B1){$ \checkmark$}, scans over temperature, field or angle (scan parameter):
- In mulab it is performed by repeated Next run and Fit.
- Performs as many chisquare minimizations(sets of parameters, chi2 values) as the number of runs in the suite.
- Fit goodness is visually kept under control by animation plots.
- Single run, multi group (A2){$ \checkmark$}. Needed for TF experiments, e.g. 2-1 and 3-4 in GPS/DOLLY - up to 4 in HIFI and ISIS, with 8 groupings of detectors. Also possible in ZF-LF experiments with spin rotated ~50 degrees, e.g. 2 - 1, 3 - 4 on GPS (but this is equivalent to a simpler group 2,3 - 1,4).
- This fit distinguishes group local parameters, like asymmetries, phases, different for different groups, from group global parameters, like fields and rates, the same across groups
- Can be fitted sequentially, group by group, reproducing multiple values of certain parameters, such as fields and relaxation rates or globally (flag gg = group global).
- This fit has its own calibration version (A2-calib?){$ \checkmark$} to obtain a distinct α value for each group.
- There are n sets of asymmetries, one per group, and the A2, A2-calib fits can be performed either sequentially or globally
- In the former case n chi2 are optimized, each with its full set of parameters; an average may be taken for fields and rates in the n sets
- In the latter case a single chi2 is optimized, the sum of the two, and the number of parameters is reduced.
- Many runs of multi group fits (B2?). Again, the groups can be fitted sequentially of globally (gg).
- This fit distinguishes group local parameters, like asymmetries, phases, different for different groups, from group global parameters, like fields and rates, the same across groups
- It has no calibration mode
- Many runs of a single group, fitted globally (C1), with a single chi2 (flag gr = global with respect to run)
- This fit distinguishes run global parameters, like asymmetries, phases, the same for all runs, from run local parameters, like fields and rates, that vary with temperature/external field, i.e. run
- Many runs of many groups, fitted globally (C2), with a single chi2 (flag G = global runs and groups)
- This fit distinguishes run global parameters, like asymmetries, phases, the same for all runs, from group global parameters, like fields and rates, that are constant in groups but vary with temperature/external field, i.e. run.
Top
|
Coding strategy
- A1, A1-calib, B1, A2 sequential fits: parameters are defined in the component list. In general the number of minuit parameters is less then the sum of the number of parameters in each component, because of shared parameters. A conversion min2int/int2min is required. Use the same, the last two cases require list of lists, the outer for either runs or groups.
- B2 sequential? is per se because it will be group-global (run- and group-sequential makes no particular sense)
- for all other fits Minuit parameter must be defined by the user in a preliminary list, as in musrfit, and assigned to component parameters in the component list. It ill also be possible to run a sequential fit before a global fit and assign sequential best fit values to their local parameter guess.
Top
|
Alternative standardized strategy (not implemented)
The standardized strategy is governed by the asymmetry shape for sequential fits (the first two cases below). Any other fit is partially or completely global and breaks this simple scheme. It must be recovered by flags. If the fit is group global (gg) no loop on groups, if the fit is run global (gr) no loop on runs, if the fit is full global (G) no loops.
- mgml.822.groups.1.json for single or multi run sequential, single group (A1,B1), and for single run multi group (A20) sequential fits. These fits are distinguished in the suite section (shape of the asymmetry array and len of the group calibration list). They share the same dashboard. The parameters are all in the "model_guess" "pardicts" section, which corresponds pretty tightly to a standard mulab gui layout. To standardize, assume that Minuit parameter values are a list of lists: [ [ [values] ] ] for single (A1) fits, [ [ [values1],[values2],... ] ] for run sequential (B1) and [ [ [values1] ],[ [values2] ],...] for group sequential (A20) fits, with list len equal to group or run number, respectively.
- almgml.822.groups.1.json for calib single run, single (A1-calib) or multi group sequential (A20-calib). Parameters all under "model_guess". Standardization would pass these as [ [ [values] ] ].
- mgml.822.2-1_3-4.gg_1.json for both single run multi group global (A21) and multi run sequential, group global (B2) fits. The two are distinguished in the suite section (the dimension of the asymmetry array). They share the dashboard, that contains user parameters in the initial "userpardicts". Its parameters coincide with the Minuit parameters. The parameters of the usual "model_guess" defining the model all have "flag": "=" and are assigned to user parameters by "function", or "function_multi". Notice also the "error_propagation_multi" for those cases in which parameters are NOT simply reassigned (sharing one minuit parameter for two model parameters) but contain non linear functions of other parameters, e.g. for fractions {$A = f\cdot A_0$}. Lastly, notice that sequential runs, sequential groups fits are not provided. The same standardization applies, [ [ [values] ] ] for single run (A21) fits, and [ [ [values1] , [values2] ,...] ] for run sequential group global (B2) fits.
- almgml.822.group_global.1.json for calib single run multi group global (A21-calib). Parameters all in "userpardicts". Standardization would pass these as [ [ [values] ] ].
- mgml.822.2-1_3-4.gg_1.json sequential for sequential runs of global multi group fit (B2). The dashboard is the same as for A21 fits. The standardization applies: this fit requires parameter [ [ [values1],[values2],...] for the sequence of runs or just [ [ [values] ] ] in the case of chain fitting, where each best fit is used as the input of the next fit in the sequence.
- mgml.822.2-1.gr_1.json for a global fit of multi run single group data (C1). Typically zero field. This fit requires processing of a single run dashboard, distinguishing "userpardicts_guess" from "userpardicts_local". These last parameters are replicated for each run. The replica is produced automatically and the link shows the result of the replication, that produces "userpardicts_local" replicas and their sharing instruction in the "function_multi" list. Standardization would pass these as [ [ [values] ] ].
- mgml.822.2-1_3-4.G_1.json for a global fit of multi run, multi group data((C2) Typically transverse field. Standardization would pass these as [ [ [values] ] ].
Top
|
Saving best fit results in the dashboard json file (and reading them back, also valid for calib mode)
- Single run, single group are saved in a "model_result" replica of "model_guess"
@save_fit@
- Single run, multi group sequential are saved in as many single run instances [
save_fit_multigroup now is different: single json file with list of "model_results", one per group]
- Single run, multi group global are saved in a "userpardicts_result" replica of userpardicts_guess" [
save_fit_multigroup now does exactly this]
- Multi run, single group sequential (B1) are saved as many single run instances [already so using
save_fit many times)
- Multi run sequential, multi-group global (B2) are saved as many single run, multi group global instances [
save_fit_multigroup could be called many times to perform this]
- Multi run global (C1 and C2) are saved in a "userpardicts_result" replica of "userpardicts_guess" plus "userpardicts_local"
Furthermore dashfit must also distinguish A20 from A21, or else mufitplot must receive mufit instance an mufit instance must store a flag
Must devise a stable internal flow of information. What is needed is
- presently, the guess dashboard, available to
mufit from the input dashboard file as self.dashboard and then
- augmented by
add_step_limits_to_model
- integrated by "gg_", "gr_" or "G_" in the dashboard["version"]
- augmented in
save_fit and save_fit_multigroup by
- "model_result" or "userpardicts_result" or "userpardicts_result and "userpardicts_local_result"
- This information is used only to feed Minuit parameter values to
mucomponent for reproducing the model, which must preserve the same shape as the asymmetry array. This is solely determined by the_suite and not by whether the fit was global or sequential in any degree. The same values are obtained directly in the_fit, as self.lastfit.values
- They are available for (A1, A21, C1, C2 fits), but, presently, sequential fits (A20, B1 and B2) overwrite the previous
self.lastfit , so only the last self.lastfit is available.
- This can be corrected easily. Let's make
self.lastfit a list, initialized empty: A1-C2 produce a single self.lastfit , which is appended. Replace its present mufit use as self.lastfit with self.lastfit[-1] , the last item, effective also for a single item.
- In this way sequential fits can append and self.lastfit items can be retrieved individually in mufitplot.
self.lastfit.values are the Minuit best fit parameter values and ca be fed directly as pars to plot_fft(fft_range,pars,asymm,asyme,real) , which avoids retrieving dashboard parameters to laboriously reconstruct the original Minuit pars by means of int2min
plot_fft simply passes pars to chi_fft which expects them as list (A1-C2) of list of lists (A20, B1, B2), can transform directly self.lastfit into a list, so that
Top
|
< Mujpy.GlobalFits | Index | Different ways of parameter indexing >
|