diff --git a/experiment/meteo_france_SCM_study/visualization/study_visualization/main_study_visualizer.py b/experiment/meteo_france_SCM_study/visualization/study_visualization/main_study_visualizer.py index 34bba367fef55a9f000a929bb6de6c2bb21dbf3d..422e05bf9d156f9f99dfa541e5348084b2e4fc90 100644 --- a/experiment/meteo_france_SCM_study/visualization/study_visualization/main_study_visualizer.py +++ b/experiment/meteo_france_SCM_study/visualization/study_visualization/main_study_visualizer.py @@ -97,7 +97,7 @@ def complete_analysis(only_first_one=False): if __name__ == '__main__': # annual_mean_vizu_compare_durand_study(safran=True, take_mean_value=True, altitude=2400) - normal_visualization(temporal_non_stationarity=True) + normal_visualization(temporal_non_stationarity=False) # max_stable_process_vizu_compare_gaume_study(altitude=1800, nb_days=1) # extended_visualization() # complete_analysis() diff --git a/thesis_report/simulation_for_quantile_gap.py b/thesis_report/simulation_for_quantile_gap.py new file mode 100644 index 0000000000000000000000000000000000000000..981df9527460d1ac7ac646f07dd2b0628b8e8ae3 --- /dev/null +++ b/thesis_report/simulation_for_quantile_gap.py @@ -0,0 +1,45 @@ + + + +import numpy as np +import matplotlib.pyplot as plt + +from extreme_estimator.extreme_models.utils import r, set_seed_r + + +def convergence_quantile_function(zoom=False): + + # Convergence of the quantile function + eps = 1e-3 + left = 0.9 if zoom else eps + p = np.linspace(left, 1-eps, 100) + + # n_list = range(1, 10) + n_list = [1, 10, 100] + for n in n_list: + v = r.qexp(np.power(p, 1/n)) + plt.plot(p, v, label=n) + quantile_perfect_gev = np.array(r.qgev(p, shape=0)) + quantile_perfect_gev += np.log(n) + plt.plot(p, quantile_perfect_gev, label='gev' + str(n)) + plt.legend() + plt.show() + # remark: convergence is from above, the block maxima quantiles are above its correspond quantile gev distribtuion + # this contradicts the hypothesis the issue I raised in "Simulation to understand quantile gap" + + +def convergence_repartition_function(): + # Convergence of the repartition function + lim = 2 + x = np.linspace(-lim, lim, 100) + plt.plot(x, r.pgev(x, shape=0), label='gev') + for n in range(1, 20, 5): + v = (np.power(r.pexp(x + np.log(n)), n)) + plt.plot(x, v, label=n) + plt.legend() + plt.show() + + +if __name__ == '__main__': + set_seed_r(seed=21) + convergence_quantile_function(zoom=True) \ No newline at end of file