diff --git a/experiment/meteo_france_data/scm_models_data/crocus/crocus_variables.py b/experiment/meteo_france_data/scm_models_data/crocus/crocus_variables.py index bd2a9b2724582517587ed75f6b81ac6a565c4952..5feaebda6cd453929f35cc60e6db333c8abe22f3 100644 --- a/experiment/meteo_france_data/scm_models_data/crocus/crocus_variables.py +++ b/experiment/meteo_france_data/scm_models_data/crocus/crocus_variables.py @@ -39,6 +39,7 @@ class AbstractSnowLoadVariable(CrocusVariable): class RecentSnowLoadVariable(AbstractSnowLoadVariable, CrocusRecentSweVariable): NAME = 'Snow load last 3 days' + class TotalSnowLoadVariable(AbstractSnowLoadVariable, CrocusTotalSweVariable): NAME = 'Snow load total' diff --git a/experiment/meteo_france_data/scm_models_data/visualization/study_visualization/study_visualizer.py b/experiment/meteo_france_data/scm_models_data/visualization/study_visualization/study_visualizer.py index 505a39d1029be645f37a858c16c4ae2905a0a268..71ea1aea01aa884ebaba229e697d628ba29e2184 100644 --- a/experiment/meteo_france_data/scm_models_data/visualization/study_visualization/study_visualizer.py +++ b/experiment/meteo_france_data/scm_models_data/visualization/study_visualization/study_visualizer.py @@ -354,16 +354,22 @@ class StudyVisualizer(VisualizationParameters): start_year, stop_year = self.study.start_year_and_stop_year return list(range(start_year, stop_year)) - def massif_name_to_altitude_and_eurocode_level_uncertainty(self, model_class, last_year_for_the_data, massif_names, ci_method, temporal_covariate) -> Dict[str, Tuple[int, EurocodeConfidenceIntervalFromExtremes]]: - massif_ids_and_names = [(massif_id, massif_name) for massif_id, massif_name in enumerate(self.study.study_massif_names) if massif_name in massif_names] - arguments = [[last_year_for_the_data, self.smooth_maxima_x_y(massif_id), model_class, ci_method, temporal_covariate] for massif_id, _ in massif_ids_and_names] + def massif_name_to_altitude_and_eurocode_level_uncertainty(self, model_class, last_year_for_the_data, massif_names, + ci_method, temporal_covariate) -> Dict[ + str, Tuple[int, EurocodeConfidenceIntervalFromExtremes]]: + massif_ids_and_names = [(massif_id, massif_name) for massif_id, massif_name in + enumerate(self.study.study_massif_names) if massif_name in massif_names] + arguments = [ + [last_year_for_the_data, self.smooth_maxima_x_y(massif_id), model_class, ci_method, temporal_covariate] for + massif_id, _ in massif_ids_and_names] if self.multiprocessing: with Pool(NB_CORES) as p: res = p.starmap(compute_eurocode_confidence_interval, arguments) else: res = [compute_eurocode_confidence_interval(*argument) for argument in arguments] res_and_altitude = [(self.study.altitude, r) for r in res] - massif_name_to_eurocode_return_level_uncertainty = OrderedDict(zip([massif_name for _, massif_name in massif_ids_and_names], res_and_altitude)) + massif_name_to_eurocode_return_level_uncertainty = OrderedDict( + zip([massif_name for _, massif_name in massif_ids_and_names], res_and_altitude)) return massif_name_to_eurocode_return_level_uncertainty # def dep_class_to_eurocode_level_uncertainty(self, model_class, last_year_for_the_data): @@ -619,25 +625,28 @@ class StudyVisualizer(VisualizationParameters): self.plot_name = plot_name self.show_or_save_to_file() - def visualize_max_graphs_poster(self, massif_name, altitude, snow_abbreviation, color): + def visualize_max_graphs_poster(self, massif_name, altitude, snow_abbreviation, color, label=None, last_plot=True, ax=None): massif_names = self.study.study_massif_names # Display the graph of the max on top - ax = plt.gca() + if ax is None: + ax = plt.gca() x, y = self.smooth_maxima_x_y(massif_names.index(massif_name)) - ax.plot(x, y, color=color, linewidth=5) + ax.plot(x, y, color=color, linewidth=5, label=label) # ax.set_ylabel('{} (in {})'.format(snow_abbreviation, self.study.variable_unit), color=color, fontsize=15) - ax.set_ylabel('{} (in {})'.format(snow_abbreviation, self.study.variable_unit), fontsize=15) - ax.set_xlabel('years', fontsize=15) - ax.set_title('{} at {} m'.format(massif_name, altitude)) - ax.xaxis.set_ticks(x[2::10]) - ax.tick_params(axis='both', which='major', labelsize=13) - # self.visualize_massif_graphs(self.visualize_mean_and_max_graph, - # specified_massif_ids=specified_massif_ids) - plot_name = 'Annual maxima of {} in {} at {}m'.format(snow_abbreviation, massif_name, altitude) - self.plot_name = plot_name - self.show_or_save_to_file(add_classic_title=False, no_title=True) - ax.clear() + if last_plot: + ax.xaxis.set_ticks(x[2::10]) + ax.tick_params(axis='both', which='major', labelsize=13) + plot_name = 'Annual maxima of {} in {} at {}m'.format(snow_abbreviation, massif_name, altitude) + self.plot_name = plot_name + ax.set_ylabel('{} (in {})'.format(snow_abbreviation, self.study.variable_unit), fontsize=15) + ax.set_xlabel('years', fontsize=15) + if label is not None: + ax.legend() + else: + ax.set_title('{} at {} m'.format(massif_name, altitude)) + self.show_or_save_to_file(add_classic_title=False, no_title=True) + ax.clear() @staticmethod def round_sig(x, sig=2): diff --git a/experiment/paper1/snow_load_trends_percentage_significant.py b/experiment/paper1/snow_load_trends_percentage_significant.py deleted file mode 100644 index ba38f673ade577d1199c272e83fa00a8a9aa9dc8..0000000000000000000000000000000000000000 --- a/experiment/paper1/snow_load_trends_percentage_significant.py +++ /dev/null @@ -1,19 +0,0 @@ -import numpy as np - -d = { - 'mu': [8, 4, 1], - 'sigma': [5, 2, 2], - "both": [9, 6, 5] -} - - -def compare(a): - assert a in ['mu', 'sigma'] - percents = [new / old for old, new in zip(d[a], d['both'])] - print(np.mean(percents)) - - -if __name__ == '__main__': - compare('mu') - compare('sigma') - # conclusion: more than 2 times more significant trends in average diff --git a/experiment/paper1/1 - non stationary model choice/__init__.py b/experiment/paper1_old/1 - non stationary model choice/__init__.py similarity index 100% rename from experiment/paper1/1 - non stationary model choice/__init__.py rename to experiment/paper1_old/1 - non stationary model choice/__init__.py diff --git a/experiment/paper1/1 - non stationary model choice/main2_choice_to_not_use_starting_years.py b/experiment/paper1_old/1 - non stationary model choice/main2_choice_to_not_use_starting_years.py similarity index 94% rename from experiment/paper1/1 - non stationary model choice/main2_choice_to_not_use_starting_years.py rename to experiment/paper1_old/1 - non stationary model choice/main2_choice_to_not_use_starting_years.py index b5a2f7c5975764a55f7c4d2ec5533ba67690abf3..1b557cc5a04ea827d9636f8eadc6f1ba95c76487 100644 --- a/experiment/paper1/1 - non stationary model choice/main2_choice_to_not_use_starting_years.py +++ b/experiment/paper1_old/1 - non stationary model choice/main2_choice_to_not_use_starting_years.py @@ -2,7 +2,7 @@ import time from experiment.meteo_france_data.scm_models_data.visualization.hypercube_visualization.altitude_year_hypercube_visualizer import \ Altitude_Hypercube_Year_Visualizer -from experiment.paper1.utils import get_full_altitude_visualizer, FULL_ALTITUDES +from experiment.paper1_old.utils import get_full_altitude_visualizer, FULL_ALTITUDES def main_fast_spatial_repartition(): diff --git a/experiment/paper1/1 - non stationary model choice/main3_non_stationary_strength_evolution.py b/experiment/paper1_old/1 - non stationary model choice/main3_non_stationary_strength_evolution.py similarity index 95% rename from experiment/paper1/1 - non stationary model choice/main3_non_stationary_strength_evolution.py rename to experiment/paper1_old/1 - non stationary model choice/main3_non_stationary_strength_evolution.py index 6b174865b1510aa59cc9b5959600e49243d85efd..78f9ba369cf70ab5f6e2728b3b26fd124fdb7fa6 100644 --- a/experiment/paper1/1 - non stationary model choice/main3_non_stationary_strength_evolution.py +++ b/experiment/paper1_old/1 - non stationary model choice/main3_non_stationary_strength_evolution.py @@ -9,7 +9,7 @@ from experiment.trend_analysis.univariate_test.gev_trend_test_two_parameters imp """ Visualize the 0.99 quantile initial value and its evolution """ -from experiment.paper1.utils import get_full_altitude_visualizer, FULL_ALTITUDES +from experiment.paper1_old.utils import get_full_altitude_visualizer, FULL_ALTITUDES def main_fast_spatial_risk_evolution(): diff --git a/experiment/paper1/1 - non stationary model choice/main4_common_spatial_altitude_starting_years_impact.py b/experiment/paper1_old/1 - non stationary model choice/main4_common_spatial_altitude_starting_years_impact.py similarity index 97% rename from experiment/paper1/1 - non stationary model choice/main4_common_spatial_altitude_starting_years_impact.py rename to experiment/paper1_old/1 - non stationary model choice/main4_common_spatial_altitude_starting_years_impact.py index 10d4fe7bd18bd83ea5821ab4d3557aea7f2f7245..a6f8594c1251e3ca862c7d28eb460076ce3682d5 100644 --- a/experiment/paper1/1 - non stationary model choice/main4_common_spatial_altitude_starting_years_impact.py +++ b/experiment/paper1_old/1 - non stationary model choice/main4_common_spatial_altitude_starting_years_impact.py @@ -9,7 +9,7 @@ from experiment.trend_analysis.univariate_test.gev_trend_test_two_parameters imp """ Visualize the 0.99 quantile initial value and its evolution """ -from experiment.paper1.utils import get_full_altitude_visualizer, FULL_ALTITUDES +from experiment.paper1_old.utils import get_full_altitude_visualizer, FULL_ALTITUDES def main_fast_spatial_risk_evolution(): diff --git a/experiment/paper1/1 - non stationary model choice/main4_common_spatial_starting_years_impact.py b/experiment/paper1_old/1 - non stationary model choice/main4_common_spatial_starting_years_impact.py similarity index 97% rename from experiment/paper1/1 - non stationary model choice/main4_common_spatial_starting_years_impact.py rename to experiment/paper1_old/1 - non stationary model choice/main4_common_spatial_starting_years_impact.py index 2973ad0f869ac3fa045b7dbb77244873a9af8fe1..46636df97ac38e10dce5dd3cdfe66ea4dc00198d 100644 --- a/experiment/paper1/1 - non stationary model choice/main4_common_spatial_starting_years_impact.py +++ b/experiment/paper1_old/1 - non stationary model choice/main4_common_spatial_starting_years_impact.py @@ -9,7 +9,7 @@ from experiment.trend_analysis.univariate_test.gev_trend_test_two_parameters imp """ Visualize the 0.99 quantile initial value and its evolution """ -from experiment.paper1.utils import get_full_altitude_visualizer, FULL_ALTITUDES +from experiment.paper1_old.utils import get_full_altitude_visualizer, FULL_ALTITUDES def main_fast_spatial_risk_evolution(): diff --git a/experiment/paper1/1 - non stationary model choice/main4_individual_starting_years_impact.py b/experiment/paper1_old/1 - non stationary model choice/main4_individual_starting_years_impact.py similarity index 96% rename from experiment/paper1/1 - non stationary model choice/main4_individual_starting_years_impact.py rename to experiment/paper1_old/1 - non stationary model choice/main4_individual_starting_years_impact.py index ada1e0731e2342f1d21ef4ad73ecdfc96e81aa5a..1d9bcaa1d1e036e9ea77f4052deb84015560f868 100644 --- a/experiment/paper1/1 - non stationary model choice/main4_individual_starting_years_impact.py +++ b/experiment/paper1_old/1 - non stationary model choice/main4_individual_starting_years_impact.py @@ -9,7 +9,7 @@ from experiment.trend_analysis.univariate_test.gev_trend_test_two_parameters imp """ Visualize the 0.99 quantile initial value and its evolution """ -from experiment.paper1.utils import get_full_altitude_visualizer, FULL_ALTITUDES +from experiment.paper1_old.utils import get_full_altitude_visualizer, FULL_ALTITUDES def main_fast_spatial_risk_evolution(): diff --git a/experiment/paper1/__init__.py b/experiment/paper1_old/__init__.py similarity index 100% rename from experiment/paper1/__init__.py rename to experiment/paper1_old/__init__.py diff --git a/experiment/paper1/poster_EVAN2019/__init__.py b/experiment/paper1_old/poster_EVAN2019/__init__.py similarity index 100% rename from experiment/paper1/poster_EVAN2019/__init__.py rename to experiment/paper1_old/poster_EVAN2019/__init__.py diff --git a/experiment/paper1/poster_EVAN2019/main_poster_EVAN2019.py b/experiment/paper1_old/poster_EVAN2019/main_poster_EVAN2019.py similarity index 99% rename from experiment/paper1/poster_EVAN2019/main_poster_EVAN2019.py rename to experiment/paper1_old/poster_EVAN2019/main_poster_EVAN2019.py index 2d81708a33bb232969841975b978a2e310bd4348..530c55f3b7a6582056a9af8382a5481680016edb 100644 --- a/experiment/paper1/poster_EVAN2019/main_poster_EVAN2019.py +++ b/experiment/paper1_old/poster_EVAN2019/main_poster_EVAN2019.py @@ -7,7 +7,7 @@ from experiment.meteo_france_data.scm_models_data.visualization.study_visualizat from experiment.trend_analysis.univariate_test.gev_trend_test_one_parameter import GevScaleTrendTest, \ GevLocationTrendTest from experiment.trend_analysis.univariate_test.gev_trend_test_two_parameters import GevLocationAndScaleTrendTest -from experiment.paper1.utils import get_full_altitude_visualizer +from experiment.paper1_old.utils import get_full_altitude_visualizer POSTER_ALTITUDES = [900, 1800, 2700] import matplotlib as mpl diff --git a/experiment/paper1/poster_EVAN2019/shape_prior_check/__init__.py b/experiment/paper1_old/poster_EVAN2019/shape_prior_check/__init__.py similarity index 100% rename from experiment/paper1/poster_EVAN2019/shape_prior_check/__init__.py rename to experiment/paper1_old/poster_EVAN2019/shape_prior_check/__init__.py diff --git a/experiment/paper1/poster_EVAN2019/shape_prior_check/analyse_shape_from_some_experiment.py b/experiment/paper1_old/poster_EVAN2019/shape_prior_check/analyse_shape_from_some_experiment.py similarity index 100% rename from experiment/paper1/poster_EVAN2019/shape_prior_check/analyse_shape_from_some_experiment.py rename to experiment/paper1_old/poster_EVAN2019/shape_prior_check/analyse_shape_from_some_experiment.py diff --git a/experiment/paper1/poster_EVAN2019/shape_prior_check/hist_values_shape.png b/experiment/paper1_old/poster_EVAN2019/shape_prior_check/hist_values_shape.png similarity index 100% rename from experiment/paper1/poster_EVAN2019/shape_prior_check/hist_values_shape.png rename to experiment/paper1_old/poster_EVAN2019/shape_prior_check/hist_values_shape.png diff --git a/experiment/paper1/poster_EVAN2019/shape_prior_check/shape_from_some_experiment.txt b/experiment/paper1_old/poster_EVAN2019/shape_prior_check/shape_from_some_experiment.txt similarity index 100% rename from experiment/paper1/poster_EVAN2019/shape_prior_check/shape_from_some_experiment.txt rename to experiment/paper1_old/poster_EVAN2019/shape_prior_check/shape_from_some_experiment.txt diff --git a/experiment/paper1/poster_EVAN2019/shape_prior_check/some_experiment_EVAN.py b/experiment/paper1_old/poster_EVAN2019/shape_prior_check/some_experiment_EVAN.py similarity index 96% rename from experiment/paper1/poster_EVAN2019/shape_prior_check/some_experiment_EVAN.py rename to experiment/paper1_old/poster_EVAN2019/shape_prior_check/some_experiment_EVAN.py index 9d0175bfb4872dbef79b61d4ec0b5fb9fb72cf87..0fc0501f9343a1897841d77d6a723a16fb7a6a86 100644 --- a/experiment/paper1/poster_EVAN2019/shape_prior_check/some_experiment_EVAN.py +++ b/experiment/paper1_old/poster_EVAN2019/shape_prior_check/some_experiment_EVAN.py @@ -9,7 +9,7 @@ from experiment.trend_analysis.univariate_test.abstract_comparison_non_stationar from experiment.trend_analysis.univariate_test.gev_trend_test_one_parameter import GevScaleTrendTest, \ GevLocationTrendTest from experiment.trend_analysis.univariate_test.gev_trend_test_two_parameters import GevLocationAndScaleTrendTest -from experiment.paper1.utils import get_full_altitude_visualizer +from experiment.paper1_old.utils import get_full_altitude_visualizer POSTER_ALTITUDES = [900, 1800, 2700] import matplotlib as mpl diff --git a/experiment/paper1/utils.py b/experiment/paper1_old/utils.py similarity index 100% rename from experiment/paper1/utils.py rename to experiment/paper1_old/utils.py diff --git a/experiment/paper1/validations/__init__.py b/experiment/paper1_old/validations/__init__.py similarity index 100% rename from experiment/paper1/validations/__init__.py rename to experiment/paper1_old/validations/__init__.py diff --git a/experiment/paper1/validations/main0_comparison_with_observations.py b/experiment/paper1_old/validations/main0_comparison_with_observations.py similarity index 100% rename from experiment/paper1/validations/main0_comparison_with_observations.py rename to experiment/paper1_old/validations/main0_comparison_with_observations.py diff --git a/experiment/paper1/validations/main1_good_stationary_gev_fit.py b/experiment/paper1_old/validations/main1_good_stationary_gev_fit.py similarity index 100% rename from experiment/paper1/validations/main1_good_stationary_gev_fit.py rename to experiment/paper1_old/validations/main1_good_stationary_gev_fit.py diff --git a/experiment/paper_past_snow_loads/__init__.py b/experiment/paper_past_snow_loads/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiment/paper_past_snow_loads/data/__init__.py b/experiment/paper_past_snow_loads/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiment/paper_past_snow_loads/data/main_eurocode_plot.py b/experiment/paper_past_snow_loads/data/main_eurocode_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiment/paper_past_snow_loads/data/main_example_swe_total_plot.py b/experiment/paper_past_snow_loads/data/main_example_swe_total_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..86d87ccf1b5c6e5ee744ed2a6cdfbe789b450327 --- /dev/null +++ b/experiment/paper_past_snow_loads/data/main_example_swe_total_plot.py @@ -0,0 +1,38 @@ +from experiment.meteo_france_data.scm_models_data.crocus.crocus import CrocusSnowLoad3Days, CrocusSnowLoadTotal +from experiment.meteo_france_data.scm_models_data.visualization.study_visualization.main_study_visualizer import \ + study_iterator_global, SCM_STUDY_CLASS_TO_ABBREVIATION +from experiment.meteo_france_data.scm_models_data.visualization.study_visualization.study_visualizer import \ + StudyVisualizer +import matplotlib.pyplot as plt + +def max_graph_annual_maxima_poster(): + """ + We choose these massif because each represents a different eurocode region + we also choose them because they belong to a different climatic area + :return: + """ + save_to_file = False + + # marker_altitude_massif_name_and_study_class = [ + # ('magenta', 900, 'Parpaillon', CrocusSnowLoadTotal), + # ('darkmagenta', 1800, 'Vercors', CrocusSnowLoadTotal), + # ('mediumpurple', 2700, 'Vanoise', CrocusSnowLoadTotal), + # ] + marker_altitude_massif_name_and_study_class = [ + ('magenta', 900, 'Ubaye', CrocusSnowLoadTotal), + ('darkmagenta', 1800, 'Vercors', CrocusSnowLoadTotal), + ('mediumpurple', 2700, 'Beaufortain', CrocusSnowLoadTotal), + ] + ax = plt.gca() + for color, altitude, massif_name, study_class in marker_altitude_massif_name_and_study_class: + for study in study_iterator_global([study_class], altitudes=[altitude]): + study_visualizer = StudyVisualizer(study, save_to_file=save_to_file, + verbose=True, + multiprocessing=True) + snow_abbreviation = SCM_STUDY_CLASS_TO_ABBREVIATION[study_class] + last_plot = altitude == 2700 + label = '{} massif at {}m'.format(massif_name, altitude) + study_visualizer.visualize_max_graphs_poster(massif_name, altitude, snow_abbreviation, color, label, last_plot, ax) + +if __name__ == '__main__': + max_graph_annual_maxima_poster() diff --git a/experiment/paper_past_snow_loads/method/study_visualizer_for_non_stationary_trends.py b/experiment/paper_past_snow_loads/method/study_visualizer_for_non_stationary_trends.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiment/paper_past_snow_loads/result_return_level_uncertainty/__init__.py b/experiment/paper_past_snow_loads/result_return_level_uncertainty/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiment/paper1/main_drawing_bayesian.py b/experiment/paper_past_snow_loads/result_return_level_uncertainty/main_bayesian_mcmc.py similarity index 97% rename from experiment/paper1/main_drawing_bayesian.py rename to experiment/paper_past_snow_loads/result_return_level_uncertainty/main_bayesian_mcmc.py index 713147f277497804c630d25d3c2a6928f75db35e..f805713033bee45198e9f854474c459e727b8d7c 100644 --- a/experiment/paper1/main_drawing_bayesian.py +++ b/experiment/paper_past_snow_loads/result_return_level_uncertainty/main_bayesian_mcmc.py @@ -70,8 +70,8 @@ def main_drawing_bayesian(): ax_return_level_posterior = axes[2] sns.kdeplot(return_level_bayesian.posterior_eurocode_return_level_samples_for_temporal_covariate, ax=ax_return_level_posterior, color=colors[-1]) - ax_return_level_posterior.set_xlabel("$z_p(\\theta)") - ax_return_level_posterior.set_ylabel("$p(z_p(\\theta)|y)") + ax_return_level_posterior.set_xlabel("$z_p(\\theta)$") + ax_return_level_posterior.set_ylabel("$p(z_p(\\theta)|y)$") plt.show() diff --git a/experiment/paper_past_snow_loads/result_snow_load_trends/__init__.py b/experiment/paper_past_snow_loads/result_snow_load_trends/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/experiment/paper_past_snow_loads/result_snow_load_trends/main_mle_diagnosis.py b/experiment/paper_past_snow_loads/result_snow_load_trends/main_mle_diagnosis.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/thesis_report/gev_plot.py b/thesis_report/gev_plot.py index 91a9d71a7dfe2d3055ba517780668cbf9f107967..f286b8e5ee6504f64f21a2a9a5fdcfa1c5f6bd6d 100644 --- a/thesis_report/gev_plot.py +++ b/thesis_report/gev_plot.py @@ -24,10 +24,11 @@ def gev_plot_big(): x = np.linspace(-lim, lim, 100) loc, scale = 1, 1 shapes = [-1, 0, 1] - for shape in shapes: + colors = ['tab:blue', 'k', 'tab:orange'] + for shape, color in zip(shapes, colors): label = '$\zeta= {} $'.format(shape) y = r.dgev(x, loc, scale, shape) - plt.plot(x, y, label=label, linewidth=10) + plt.plot(x, y, label=label, linewidth=10, color=color) plt.legend(prop={'size': 20}) plt.xlabel('$y$', fontsize=15) plt.ylabel('$f_{GEV}(y|1,1,\zeta)$', fontsize=15) @@ -38,8 +39,8 @@ def gev_plot_big(): def gev_plot_big_non_stationary_location(): lim = 5 x = np.linspace(-lim, lim, 100) - scale, shape = 1, 0.0 - locs = [1, 2, 3] + scale, shape = 1, 0 + locs = [0.5, 1, 2] inverse_loc_with_scale = True colors = ['red','k', 'green'] greek_leeter = ' $\{}_1'.format('mu' if not inverse_loc_with_scale else 'sigma') @@ -55,6 +56,7 @@ def gev_plot_big_non_stationary_location(): label = template.format(sign_str) if inverse_loc_with_scale: loc, scale = scale, loc + print(loc, scale, shape) y = r.dgev(x, loc, scale, shape) plt.plot(x, y, label=label, linewidth=5, color=color) plt.legend(prop={'size': 20}) @@ -117,8 +119,8 @@ def quantile_function_plot(): if __name__ == '__main__': - # gev_plot_big() - gev_plot_big_non_stationary_location() + gev_plot_big() + # gev_plot_big_non_stationary_location() # max_stable_plot() # quantile_function_plot() # max_stable_plot_v2()