Commit 4ddb7ec0 authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[SIMULATION] add draft

parent da63d6c9
No related merge requests found
Showing with 57 additions and 5 deletions
+57 -5
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
......@@ -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()
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