Commit f5e085b5 authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[TREND ANALYSIS] add verbose argument when creating hypercube visualizer. add...

[TREND ANALYSIS] add verbose argument when creating hypercube visualizer. add shape analysis from the MLE estimator, and the shapes are indeed between -0.4 and 0.4
parent 90a15a57
No related merge requests found
Showing with 424 additions and 6 deletions
+424 -6
......@@ -32,11 +32,13 @@ def load_quantity_visualizer(quantity_hypercube_class, altitudes, last_starting_
def load_altitude_visualizer(altitude_hypercube_class, altitudes, last_starting_year, nb_data_reduced_for_speed,
only_first_one, save_to_file, study_classes, trend_test_class
, exact_starting_year=None, first_starting_year=1958,
orientations=None):
orientations=None,
verbose=True):
visualizers = [StudyVisualizer(study, temporal_non_stationarity=True, verbose=False, multiprocessing=True)
for study in study_iterator_global(study_classes=study_classes, only_first_one=only_first_one,
altitudes=altitudes,
orientations=orientations)]
orientations=orientations,
verbose=verbose)]
altitude_to_visualizer = OrderedDict(zip(altitudes, visualizers))
visualizer = altitude_hypercube_class(altitude_to_visualizer,
save_to_file=save_to_file,
......@@ -45,6 +47,7 @@ def load_altitude_visualizer(altitude_hypercube_class, altitudes, last_starting_
last_starting_year=last_starting_year,
first_starting_year=first_starting_year,
exact_starting_year=exact_starting_year,
verbose=verbose,
)
assert isinstance(visualizer, AltitudeHypercubeVisualizer)
return visualizer
import matplotlib.pyplot as plt
# Load shapes
lines = []
with open('shape_from_some_experiment.txt') as f:
for l in f:
lines.append(float(l.split('\n')[0]))
# Build his
plt.hist(lines, bins=50, histtype='step')
plt.show()
\ No newline at end of file
experiment/paper1_steps/poster_EVAN2019/shape_prior_check/hist_values_shape.png

9.93 KB

-0.17986546997305747
-0.21512821907488117
-0.22839258514334876
-0.2498225571434785
-0.10453885381717745
-0.11536301350989701
-0.21098040403900203
-0.3050659290512925
-0.15925873857758652
-0.17268190177825643
-0.2594056844372453
-0.28039798550349143
-0.06722834840436546
-0.1479118601104086
-0.21433354559531342
-0.28211290009969725
-0.0887680562068616
-0.2208205997056717
-0.10494743088832467
-0.11452045521531878
0.028945433687082932
0.0067015122458568815
-0.1472801324090879
-0.22098011094150238
-0.0610051579422065
-0.09022142187635976
-0.13520802315098068
-0.12338337567622575
-0.011899752730240097
-0.05310318658946517
-0.06023136975812889
-0.06563016191691054
-0.03974170346172862
-0.03827310510219756
-0.21367056961008526
-0.20203181697856493
-0.21188535197847605
-0.1639189163167375
-0.10616033170445793
-0.10950723984817709
0.13299031367466324
0.13458707050406582
0.07547256999354447
0.07553864770823433
0.23444800760973622
0.23630698649068987
-0.17986546997305747
-0.12857827749906253
-0.22839258514334876
-0.23992665528817214
-0.10453885381717745
-0.09501113151618684
-0.21098040403900203
-0.267924138055065
-0.15925873857758652
-0.1632068762563936
-0.2594056844372453
-0.29430696329291695
-0.06722834840436546
-0.1723186485631052
-0.21433354559531342
-0.2820272223403669
-0.0887680562068616
-0.1998469561489447
-0.10494743088832467
-0.10687122711559201
0.028945433687082932
-0.0035694057343077634
-0.1472801324090879
-0.16226667617602392
-0.0610051579422065
-0.1881631947332648
-0.13520802315098068
-0.18064106727025547
-0.011899752730240097
-0.044448559505585454
-0.06023136975812889
-0.0603700543349135
-0.03974170346172862
-0.046393073508512156
-0.21367056961008526
-0.18470833159640074
-0.21188535197847605
-0.2512896889755669
-0.10616033170445793
-0.11765252724444987
0.13299031367466324
0.11442126594429894
0.07547256999354447
0.06645974620355453
0.23444800760973622
0.23607921468817256
-0.17986546997305747
-0.11767421855242631
-0.22839258514334876
-0.24300684469910894
-0.10453885381717745
-0.03744201572720143
-0.21098040403900203
-0.24560126821798106
-0.15925873857758652
-0.16152378998653077
-0.2594056844372453
-0.3007158748567143
-0.06722834840436546
-0.15841519158251238
-0.21433354559531342
-0.2686522942568237
-0.0887680562068616
-0.14987108005772576
-0.10494743088832467
-0.11016932479851534
0.028945433687082932
-0.018940487347995708
-0.1472801324090879
-0.15248545102652994
-0.0610051579422065
-0.21025410178814968
-0.13520802315098068
-0.17856344747026348
-0.011899752730240097
-0.04010152067388792
-0.06023136975812889
-0.060863919099542585
-0.03974170346172862
-0.04705695832001752
-0.21367056961008526
-0.18568613549947116
-0.21188535197847605
-0.22060391513735975
-0.10616033170445793
-0.12036731892022036
0.13299031367466324
0.11117383548536468
0.07547256999354447
0.07252132278308279
0.23444800760973622
0.23727953535405227
-0.07167408155700153
-0.07284068855576813
-0.09537461461592106
-0.09129636040505239
-0.03565240312207722
-0.03632498473754695
-0.03820593178143043
-0.07121744555334567
-0.04012032394334429
-0.0421795471212244
-0.38124963216329727
-0.4072920662869968
0.13908474912174423
0.31108640183679825
-0.06366732312024873
-0.08142802214894124
-0.04043456397190185
-0.06209554218262815
-0.10306101124433735
-0.105061605902908
0.26495290044739506
0.2651693537670664
-0.0554182614697758
-0.12952225331810446
-0.006287103759081175
-0.023577383744064054
0.09567628293191234
0.19154502325337455
0.14014740161102704
0.09305836929837064
0.06304171036103452
0.06811512321802246
0.24709760299667172
0.24546539155981217
0.16576276213650265
0.16682452330147396
-0.04716342309438759
-0.050693380192965404
-0.018339224787634383
-0.04390430160195761
0.034030477584533134
0.03221808998045728
-0.006686894148799695
-0.003653548445140834
-0.0409527995366322
-0.04330533674810822
-0.07167408155700153
-0.07385322485385248
-0.09537461461592106
-0.08691089793940054
-0.03565240312207722
-0.035961500074552614
-0.03820593178143043
-0.04904968521387157
-0.04012032394334429
-0.040058422832121424
-0.38124963216329727
-0.4255775255857207
0.13908474912174423
0.32948472064054846
-0.06366732312024873
-0.06581014041501734
-0.04043456397190185
-0.0473115474051234
-0.10306101124433735
-0.1034503812140259
0.26495290044739506
0.26583070811307496
-0.0554182614697758
-0.10382805329318165
-0.006287103759081175
-0.06161039910393466
0.09567628293191234
0.1707671228679576
0.14014740161102704
0.10063236364861382
0.06304171036103452
0.07241723165747403
0.24709760299667172
0.2464524828762165
0.16576276213650265
0.16708560345285467
-0.04716342309438759
-0.04223688297742566
-0.018339224787634383
-0.05621326427186505
0.034030477584533134
0.015112983286377522
-0.006686894148799695
0.0084135985045764
-0.0409527995366322
-0.041330879541588206
-0.07167408155700153
-0.07610750819868832
-0.09537461461592106
-0.08595044610907085
-0.03565240312207722
-0.036908752736647336
-0.03820593178143043
-0.06473281826001054
-0.04012032394334429
-0.03788220693764348
-0.38124963216329727
-0.42807544746430654
0.13908474912174423
0.3384350785635435
-0.06366732312024873
-0.0725640855386424
-0.04043456397190185
-0.05175116106078634
-0.10306101124433735
-0.10222160920574865
0.26495290044739506
0.2604726253803136
-0.0554182614697758
-0.1147454497634801
-0.006287103759081175
-0.08823807685369725
0.09567628293191234
0.18364291387325196
0.14014740161102704
0.05730792075979853
0.06304171036103452
0.07211510826670224
0.24709760299667172
0.24675719313983843
0.16576276213650265
0.1662832108850845
-0.04716342309438759
-0.036858800462481356
-0.018339224787634383
-0.06485242301330693
0.034030477584533134
-0.001833316760152273
-0.006686894148799695
0.008107799213101277
-0.0409527995366322
-0.039515631316688726
0.023153980046429462
0.028368437709736436
0.02382835483828985
0.05668510096794785
0.05768326430840509
0.07154526043214227
0.030043102735118146
0.04231645787397986
-0.17175820929152086
-0.14520180164338675
0.0028562069807351372
0.036598025744808194
-0.029649574367349434
-0.03599847625320862
-0.044957908239197805
-0.029960661741132214
0.4561885125552172
0.46062013837736504
-0.012661463769511036
-0.02273628741179249
0.024635517950243817
0.028985695188802826
0.06861234003281175
0.06896891203654665
0.010549053211388493
0.008453432608898706
0.20904284330405942
0.213052274459237
0.07335130956548458
-0.013503329370868473
0.08037111672081598
0.07975178731239568
0.022768386837852123
0.014691330687326493
0.18829249971095505
0.1834474831546366
-0.09443055073415636
-0.11433649025507156
-0.017603453383083965
-0.02450581033427974
0.023153980046429462
0.035206263268310826
0.02382835483828985
0.07921884186951642
0.05768326430840509
0.07108059383978341
0.030043102735118146
0.06285698052791111
-0.17175820929152086
-0.16311239604418018
0.0028562069807351372
0.09585120070226141
-0.029649574367349434
0.008434149867197758
-0.044957908239197805
-0.005172810269527511
0.4561885125552172
0.4611735283254629
-0.012661463769511036
-0.014583956392028854
0.024635517950243817
0.016769887124387435
0.06861234003281175
0.022837477304427034
0.010549053211388493
-0.02916284149819585
0.20904284330405942
0.17779321734729808
0.07335130956548458
-0.00035516640950627006
0.08037111672081598
0.02335057573261063
0.022768386837852123
0.0025935572691968556
0.18829249971095505
0.1843362900913051
-0.09443055073415636
-0.12516161155424058
-0.017603453383083965
-0.03341544379480277
0.023153980046429462
0.03056795906937061
0.02382835483828985
0.06871705590566193
0.05768326430840509
0.06826999150314064
0.030043102735118146
0.06251686121956282
-0.17175820929152086
-0.1583926069310994
0.0028562069807351372
0.09549477544547744
-0.029649574367349434
0.005458378484294713
-0.044957908239197805
-0.007512152372008501
0.4561885125552172
0.45922425158297886
-0.012661463769511036
-0.012099524333183728
0.024635517950243817
0.010166201478040926
0.06861234003281175
0.016880844841037745
0.010549053211388493
-0.023541225896109897
0.20904284330405942
0.16934269602225305
0.07335130956548458
0.002218562767923835
0.08037111672081598
0.013182217830514917
0.022768386837852123
-0.008410124971168734
0.18829249971095505
0.16467866697088315
-0.09443055073415636
-0.12436056994005414
-0.017603453383083965
-0.03351139880158266
\ No newline at end of file
......@@ -21,11 +21,11 @@ def main_non_stationary_model_comparison():
stop_loop = False
for altitude in POSTER_ALTITUDES[:]:
for trend_test_class in [GevLocationTrendTest, GevScaleTrendTest, GevLocationAndScaleTrendTest,
ComparisonAgainstMu, ComparisonAgainstSigma][::-1][:]:
ComparisonAgainstMu, ComparisonAgainstSigma][:3]:
vizualiser = get_full_altitude_visualizer(Altitude_Hypercube_Year_Visualizer, altitude=altitude,
exact_starting_year=1958, reduce_strength_array=False,
trend_test_class=trend_test_class,
)
verbose=False)
# vizualiser.save_to_file = False
vizualiser.visualize_massif_trend_test_one_altitude(poster_plot=True, write_text_on_massif=False)
if stop_loop:
......
......@@ -13,7 +13,8 @@ def get_full_altitude_visualizer(altitude_hypercube_class, exact_starting_year=N
trend_test_class = GevLocationTrendTest,
offset_starting_year=10,
study_class=CrocusSwe3Days,
orientation=None):
orientation=None,
verbose=True):
altitudes, first_starting_year, last_starting_year, nb_data_reduced_for_speed, only_first_one, save_to_file, _ = get_full_parameters(
altitude=altitude, offset_starting_year=offset_starting_year)
if exact_starting_year is not None:
......@@ -23,6 +24,7 @@ def get_full_altitude_visualizer(altitude_hypercube_class, exact_starting_year=N
nb_data_reduced_for_speed, only_first_one, save_to_file, study_classes,
trend_test_class, first_starting_year=first_starting_year,
exact_starting_year=exact_starting_year,
orientations=[orientation])
orientations=[orientation],
verbose=verbose)
visualizer.reduce_strength_array = reduce_strength_array
return visualizer
......@@ -120,6 +120,13 @@ class AbstractGevTrendTest(AbstractUnivariateTest):
return self.non_stationary_estimator.margin_function_fitted.get_gev_params(coordinate=np.array([1958]),
is_transformed=False)
@cached_property
def stationary_constant_gev_params(self) -> GevParams:
# Constant parameters correspond to any gev params
return self.stationary_estimator.margin_function_fitted.get_gev_params(coordinate=np.array([1958]),
is_transformed=False)
@property
def test_trend_slope_strength(self):
if self.crashed:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment