English Français

Documentation / User's manual in Python : PDF version

XIV.13. Macros UncertModeler

XIV.13. Macros UncertModeler

XIV.13.1. Macro "uncertModelerTestsYoungsModulus.py"

XIV.13.1.1. Objective

The objective of the macro is to pass the 3 tests of fit based on Empirical Distribution Function (EDF) statistics (Kolmogorov-Smirnov (D), Cramer-VonMises (W2) and Anderson-Darling (A2)) on the attribute "E" in the "youngsmodulus" dataset. The tested law is the "normal" distribution when both the mean (30576) and variance (1450) are set or when both are defined either from the sample.

XIV.13.1.2. Macro Uranie

"""
Example of distribution testing with quality criteria on data
"""
from rootlogon import ROOT, DataServer, UncertModeler

tds = DataServer.TDataServer()
tds.fileDataRead("youngsmodulus.dat")

c = ROOT.TCanvas("c1", "Test on youngsmodulus dataset", 13, 38, 1210, 1874)
pad = ROOT.TPad("pad", "pad", 0, 0.03, 1, 1)
pad.Draw()
pad.Divide(1, 3)

tks = UncertModeler.TTestKolmogorovSmirnov(tds, "E")
pad.cd(1)
tks.computeScore("normal:normal(30576,1450)")

tcvm = UncertModeler.TTestCramerVonMises(tds, "E")
pad.cd(2)
tcvm.computeScore("normal:normal(30576,1450)")

tad = UncertModeler.TTestAndersonDarling(tds, "E")
pad.cd(3)
tad.computeScore("normal:normal(30576,1450)")

XIV.13.1.3. Graph

Figure XIV.110. Graph of the macro macro "uncertModelerTestsYoungsModulus.py"

Graph of the macro macro "uncertModelerTestsYoungsModulus.py"

XIV.13.2. Macro "uncertModelerCirce.py"

XIV.13.2.1. Objective

The objective of the macro uncertModelerCirce is to apply the Circe method on the dataset "jdd_circe_summerschool2006_dataserver.dat", which contains 150 patterns described by 4 attributes ("code","exp" and the derivative from the two parameters "sens1" and "sens2" of the study).

#COLUMN_NAMES: code | exp  | sens1 | sens2

       0.853828       0.720995       1.280695       0.426961
       1.420676       1.467705       2.130798       0.710554
       1.986837       1.277730       2.979664       0.994010
       2.552036       1.991193       3.826800       1.277273
       3.116001       2.036849       4.671714       1.560289
       3.678459       3.445518       5.513915       1.843002
       4.239138       4.735902       6.352916       2.125359
       4.797768       3.381548       7.188232       2.407304
       5.354081       5.383797       8.019378       2.688784
       5.907808       5.001590       8.845874       2.969742
       6.458685       5.330333       9.667245       3.250125
       7.006447       7.952286      10.483015       3.529879
       7.550833       4.561176      11.292717       3.808950
       8.091583       7.968353      12.095884       4.087283
       8.628440       8.644601      12.892057       4.364824
       9.161150       7.772117      13.680780       4.641520
       9.689460      11.946291      14.461602       4.917317
      10.213121       9.110840      15.234080       5.192162
      10.731888       9.179312      15.997775       5.466002
      11.245518      12.044400      16.752254       5.738783
      11.753772       9.955391      17.497091       6.010453
      12.256413       8.516376      18.231867       6.280959
      12.753210      11.832538      18.956171       6.550249
      13.243933      15.764511      19.669597       6.818270
      13.728360      13.636206      20.371749       7.084971
      14.206269      15.828666      21.062237       7.350300
      14.677444      15.371526      21.740682       7.614206
      15.141674      17.624294      22.406711       7.876637
      15.598751      16.365027      23.059960       8.137543
      16.048474      13.622278      23.700075       8.396873
      16.490644      16.654472      24.326711       8.654577
      16.925069      18.445503      24.939533       8.910605
      17.351561      21.030571      25.538214       9.164908
      17.769937      17.357715      26.122438       9.417436
      18.180020      11.956423      26.691900       9.668140
      18.581638      19.157803      27.246304       9.916972
      18.974624      16.126637      27.785365      10.163884
      19.358818      18.922050      28.308810      10.408827
      19.734065      20.848071      28.816374      10.651755
      20.100213      18.048485      29.307807      10.892620
      20.457121       8.858695      29.782866      11.131376
      20.804650      17.677597      30.241324      11.367976
      21.142669      22.920734      30.682962      11.602375
      21.471051      18.370473      31.107575      11.834528
      21.789678      16.656787      31.514968      12.064388
      22.098436      19.602911      31.904959      12.291912
      22.397218      27.669603      32.277379      12.517056
      22.685923      22.298174      32.632070      12.739777
      22.964458      21.384184      32.968887      12.960030
      23.232734      30.519337      33.287695      13.177773
      23.490671      15.001831      33.588376      13.392965
      23.738192      25.366767      33.870822      13.605563
      23.975231      23.949371      34.134936      13.815527
      24.201726      13.391711      34.380637      14.022815
      24.417621      21.553269      34.607854      14.227387
      24.622868      26.531200      34.816530      14.429205
      24.817425      20.392323      35.006621      14.628229
      25.001258      32.189940      35.178096      14.824419
      25.174337      20.032718      35.330935      15.017740
      25.336642      26.195740      35.465133      15.208152
      25.488157      30.414972      35.580695      15.395619
      25.628873      29.119988      35.677642      15.580104
      25.758789      32.045293      35.756006      15.761573
      25.877910      21.195366      35.815830      15.939990
      25.986247      28.350611      35.857174      16.115319
      26.083817      38.814487      35.880105      16.287529
      26.170646      31.542012      35.884708      16.456584
      26.246764      26.275016      35.871075      16.622452
      26.312208      38.313217      35.839315      16.785102
      26.367023      28.568492      35.789546      16.944501
      26.411259      31.091609      35.721899      17.100619
      26.444972      16.263460      35.636518      17.253425
      26.468224      21.124831      35.533558      17.402891
      26.481085      33.708891      35.413184      17.548986
      26.483629      24.250273      35.275576      17.691683
      26.475938      35.046525      35.120922      17.830954
      26.458098      24.052985      34.949423      17.966773
      26.430201      34.135678      34.761291      18.099112
      26.392347      27.700029      34.556749      18.227946
      26.344640      32.737134      34.336029      18.353251
      26.287189      28.450629      34.099376      18.475001
      26.220109      23.829647      33.847044      18.593174
      26.143522      27.528282      33.579297      18.707747
      26.057552      36.671849      33.296408      18.818696
      25.962331      26.930743      32.998661      18.926002
      25.857996      32.444448      32.686349      19.029643
      25.744687      28.236267      32.359775      19.129598
      25.622549      22.031751      32.019249      19.225849
      25.491734      21.495018      31.665091      19.318378
      25.352397      21.132186      31.297629      19.407165
      25.204696      19.217357      30.917198      19.492194
      25.048797      26.490158      30.524145      19.573449
      24.884866      21.316733      30.118819      19.650913
      24.713076      25.592418      29.701580      19.724572
      24.533603      19.577027      29.272793      19.794412
      24.346625      34.922599      28.832833      19.860418
      24.152327      35.735641      28.382076      19.922578
      23.950895      19.302306      27.920910      19.980881
      23.742519      22.246825      27.449724      20.035314
      23.527392      27.026746      26.968916      20.085868
      23.305709      22.656735      26.478887      20.132532
      23.077671      15.588268      25.980044      20.175297
      22.843477      26.051802      25.472798      20.214156
      22.603332      26.182246      24.957565      20.249100
      22.357443      38.381341      24.434763      20.280123
      22.106018      22.768312      23.904816      20.307219
      21.849267      26.030200      23.368151      20.330382
      21.587402      15.635641      22.825196      20.349609
      21.320639      18.753400      22.276382      20.364895
      21.049191      20.947923      21.722145      20.376237
      20.773276      24.642890      21.162919      20.383634
      20.493113      14.828323      20.599142      20.387083
      20.208919      17.455233      20.031254      20.386585
      19.920916      16.168686      19.459693      20.382139
      19.629322      15.843812      18.884899      20.373745
      19.334360      18.983964      18.307313      20.361407
      19.036251      20.541221      17.727376      20.345126
      18.735215      14.704089      17.145526      20.324904
      18.431475      27.724483      16.562203      20.300747
      18.125252      20.854847      15.977844      20.272659
      17.816766      15.890789      15.392886      20.240646
      17.506238      16.750030      14.807764      20.204712
      17.193888      10.107342      14.222909      20.164866
      16.879934      15.763192      13.638752      20.121116
      16.564594      27.922521      13.055719      20.073469
      16.248084      14.705787      12.474234      20.021934
      15.930621       9.417969      11.894719      19.966523
      15.612417      13.446139      11.317589      19.907245
      15.293685      13.532392      10.743257      19.844112
      14.974634      20.769703      10.172131      19.777137
      14.655473      17.227635       9.604615      19.706331
      14.336409      12.008431       9.041108      19.631710
      14.017644      17.118440       8.482001      19.553287
      13.699381      14.424335       7.927684      19.471078
      13.381817      14.105580       7.378537      19.385098
      13.065150       8.072573       6.834935      19.295364
      12.749572      10.533065       6.297249      19.201894
      12.435272      11.022880       5.765839      19.104706
      12.122439      12.865744       5.241061      19.003818
      11.811257      10.789248       4.723263      18.899250
      11.501904       5.134292       4.212786      18.791022
      11.194558      11.284947       3.709961      18.679155
      10.889392      10.426379       3.215113      18.563671
      10.586576       8.555081       2.728559      18.444593
      10.286274      10.517881       2.250605      18.321943
       9.988648      12.657006       1.781552      18.195744
       9.693856       9.822359       1.321689      18.066023
       9.402049       9.082523       0.871296      17.932802
       9.113378      12.983850       0.430646      17.796110
       8.827985       6.205202       -2.89e-15     17.655971

XIV.13.2.2. Macro Uranie

"""
Example of Circe method application
"""
from rootlogon import DataServer, UncertModeler

tds = DataServer.TDataServer()
tds.fileDataRead("jdd_circe_summerschool2006_dataserver.dat")

# tds.addAttribute("uexp", "0.05*exp")
# tds.addAttribute("sens3", "sens1*sens2")

# Create the TCirce object from the TDS and specify Experimental attribute
# but also Code attribute and sensitivity attributes
tc = UncertModeler.TCirce(tds, "exp", "code", "sens1,sens2")
# tc.setTolerance(1e-5)
# tc.setYStarSigma("uexp")
# tc.setNCMatrix(5)

# TMatrixD initCMat(2,2)
# initCMat.Zero(); initCMat(0,0) = 0.042737; initCMat(1,1) = 0.525673
# tc.setCMatrixInitial(initCMat)

# TVectorD initBVec(2)
# initBVec(0) = -1.436394; initBVec(1) = -1.501561
# tc.setBVectorInitial(initBVec)
tc.estimate()

# Post-treatment
vBiais = tc.getBVector()
print(" ** vBiais rows["+str(vBiais.GetNrows())+"]")
vBiais.Print()

matC = tc.getCMatrix()
print(" ** matC rows["+str(matC.GetNrows())+"] col ["+str(matC.GetNcols())+"]")
matC.Print()

XIV.13.2.3. Console

Processing uncertModelerCirce.py...

--- Uranie v0.0/0 --- Developed with ROOT (6.32.02)
                      Copyright (C) 2013-2024 CEA/DES 
                      Contact: support-uranie@cea.fr 
                      Date: Tue Jan 09, 2024

 *********
 ** addData from an another TDS [jdd_circe_summerschool2006_dataserver]
 ** YStar[exp]  YStarSigma[]YHat[code]
 **  Sensitivity Attributes[sens1 sens2]
 ** nparameter [sens1 sens2] size[2]
 ** List Of TDS size[1]
Collection name='TList', class='TList', size=1
 OBJ: URANIE::DataServer::TDataServer	jdd_circe_summerschool2006_dataserver	_title_
 ** List Of Informations size[3]
Collection name='TList', class='TList', size=3
 OBJ: TNamed	__Circe_YStar_jdd_circe_summerschool2006_dataserver_1__	exp
 OBJ: TNamed	__Circe_YHat_jdd_circe_summerschool2006_dataserver_1__	code
 OBJ: TNamed	__Circe_Sensitivity_jdd_circe_summerschool2006_dataserver_1__	sens1,sens2
 ** End Of addData from an another TDS [jdd_circe_summerschool2006_dataserver]
 *********

 **********************************
 ** Begin Of Initial Matrix C [1/1]

 ** CIRCE HAS CONVERGED
 ** iter[90] ** Likelihood[-2.729559333111159]
 ***** Selected :: iter[0] Likelihood[-2.729559333111159]
 ** matrix C1 

2x2 matrix is as follows

     |      0    |      1    |
-------------------------------
   0 |    0.01612           0 
   1 |          0     0.03616 


 ** vector XM1

Vector (2)  is as follows

     |        1  |
------------------
   0 |-0.0131705 
   1 |0.0106155 

 ** End Of Initial Matrix C [1/1]
 **********************************
 ** Residual :: Mean [-0.007054035043120376] Std[1.003324966600461]
 ** vBiais rows[2]

Vector (2)  is as follows

     |        1  |
------------------
   0 |-0.0131705 
   1 |0.0106155 

 ** matC rows[2] col [2]

2x2 matrix is as follows

     |      0    |      1    |
-------------------------------
   0 |    0.01612           0 
   1 |          0     0.03616 

/language/en