diff --git a/experiment/simulation/draft_main.py b/experiment/simulation/draft_main.py new file mode 100644 index 0000000000000000000000000000000000000000..7537b9229e08a00803b0e61e89057c42f1fdac18 --- /dev/null +++ b/experiment/simulation/draft_main.py @@ -0,0 +1,47 @@ + + + +if __name__ == '__main__': + # Parameters + scenarios = [] + nb_obs_list = [] + nb_fit = 1000 + + # Load the object that will handle the simulation + simu = Simulations(nb_fit, scenarios, nb_obs_list) + + # Fit many estimators to this simulation + estimator_types = [] + for estimator_type in estimator_types: + simu.fit(estimator_type) + + # Comparison of the diverse estimator + + # Compare all the estimator on a global graph (one graph per scenario) + # On each graph the X axis should be the number of obs + # the Y graph should the error + simu.visualize_mean_test_error_graph(estimator_types, scenarios, nb_obs_list) + # the other possible view, is to have one graph per number of observations + # on the X axis should the name of the different estimator + # on the y axis their error + + + # Plot the same graph for the train/test error + # For a single scenario, and a single obs (we give a plot detailing all the estimation steps that enabled to get + # the result) + simu.visualize_comparison_graph(estimator_types, scenario, nb_obs) + + # Analyse the result of a single estimator + + # Or all the result could be recorded in a matrix, with scenario as line, and nb_observaitons as columns + # with the mean value (and the std in parenthesis) + # (on the border on this matrix we should have the mean value) + # for example, the first columns should be the mean of the other column for the same line + simu.visualize_mean_test_error_matrix(estimator_type, scenarios, nb_obs_list) + + + # + simu.visualize + + + diff --git a/experiment/simulation/lin_space2_simulation.py b/experiment/simulation/lin_space2_simulation.py index bac71fc1e0721a62cb79c742246e53e9019eb666..d4c0a01141b5be0f96c07a7ac86cc26317262a45 100644 --- a/experiment/simulation/lin_space2_simulation.py +++ b/experiment/simulation/lin_space2_simulation.py @@ -15,15 +15,20 @@ class LinSpace5Simulation(AbstractSimulation): def __init__(self, nb_fit=1): super().__init__(nb_fit) # Simulation parameters + # Number of observations self.nb_obs = 60 - self.coordinates = LinSpaceSpatialCoordinates.from_nb_points(nb_points=100, train_split_ratio=0.75) - # MarginModel Linear with respect to the shape (from 0.01 to 0.02) + # 1 dimensional spatial coordinates (separated in train split and test split) + self.coordinates = LinSpaceSpatialCoordinates.from_nb_points(nb_points=100, + train_split_ratio=0.75) + # MarginModel Constant for simulation params_sample = { (GevParams.GEV_LOC, 0): 1.0, (GevParams.GEV_SHAPE, 0): 1.0, (GevParams.GEV_SCALE, 0): 1.0, } - self.margin_model = ConstantMarginModel(coordinates=self.coordinates, params_sample=params_sample) + self.margin_model = ConstantMarginModel(coordinates=self.coordinates, + params_sample=params_sample) + # MaxStable Model for simulation self.max_stable_model = Smith() def dump(self): @@ -37,6 +42,6 @@ if __name__ == '__main__': simu = LinSpace5Simulation(nb_fit=10) simu.dump() estimators_class = MARGIN_ESTIMATORS_FOR_SIMULATION + FULL_ESTIMATORS_FOR_SIMULATION - for estimator_class in estimators_class[:]: - simu.fit(estimator_class, show=False) + # for estimator_class in estimators_class[:]: + # simu.fit(estimator_class, show=False) simu.visualize_comparison_graph()