Commit 05a80ecc authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

refactoring and renaming

parent 8854ee98
No related merge requests found
Showing with 25 additions and 24 deletions
+25 -24
......@@ -4,8 +4,8 @@ import rpy2.robjects.numpy2ri as rpyn
import os.path as op
# Defining some constants
from extreme_estimator.R_model.gev.gev_parameters import GevParams
from extreme_estimator.R_model.utils import get_associated_r_file
from extreme_estimator.gev_params import GevParams
from extreme_estimator.extreme_models.utils import get_associated_r_file
def gev_mle_fit(x_gev: np.ndarray, start_loc=0, start_scale=1, start_shape=0):
......
from extreme_estimator.R_model.max_stable_model.abstract_max_stable_model import AbstractMaxStableModel, CovarianceFunction
from extreme_estimator.R_model.max_stable_model.max_stable_models import Smith, BrownResnick, Schlather, ExtremalT
from extreme_estimator.extreme_models.max_stable_model.abstract_max_stable_model import AbstractMaxStableModel, \
CovarianceFunction
from extreme_estimator.extreme_models.max_stable_model.max_stable_models import Smith, BrownResnick, Schlather, \
ExtremalT
from extreme_estimator.estimator.abstract_estimator import AbstractEstimator
from extreme_estimator.estimator.max_stable_estimator import MaxStableEstimator
from extreme_estimator.robustness_plot.multiple_plot import MultiplePlot
from extreme_estimator.robustness_plot.single_plot import SinglePlot
from spatio_temporal_dataset.dataset.simulation_dataset import SimulatedDataset
from spatio_temporal_dataset.dataset.simulation_dataset import SimulatedDataset, MaxStableDataset
from spatio_temporal_dataset.spatial_coordinates.abstract_spatial_coordinates import AbstractSpatialCoordinates
from spatio_temporal_dataset.spatial_coordinates.alps_station_2D_coordinates import \
AlpsStation2DCoordinatesBetweenZeroAndOne, AlpsStationCoordinatesBetweenZeroAndTwo
......@@ -39,9 +41,9 @@ class MspSpatial(object):
nb_station = self.NbStationItem.value_from_kwargs(**kwargs_single_point)
nb_obs = self.NbObservationItem.value_from_kwargs(**kwargs_single_point)
# Run the estimation
spatial_coordinate = spatial_coordinate_class.from_nb_points(nb_points=nb_station)
dataset = SimulatedDataset.from_max_stable_sampling(nb_obs=nb_obs, max_stable_model=max_stable_model,
spatial_coordinates=spatial_coordinate)
spatial_coordinates = spatial_coordinate_class.from_nb_points(nb_points=nb_station)
dataset = MaxStableDataset.from_sampling(nb_obs=nb_obs, max_stable_model=max_stable_model,
spatial_coordinates=spatial_coordinates)
estimator = MaxStableEstimator(dataset, max_stable_model)
estimator.fit()
return estimator.scalars(max_stable_model.params_sample)
......@@ -88,7 +90,7 @@ def multiple_spatial_robustness_alps():
nb_samples=nb_sample,
main_title="Max stable analysis with {} years of observations".format(nb_observation),
plot_png_filename=plot_name
)
)
# Load all the models
msp_models = [Smith(), BrownResnick()]
# for covariance_function in CovarianceFunction:
......
from extreme_estimator.R_model.margin_model.abstract_margin_model import AbstractMarginModel
from extreme_estimator.R_model.max_stable_model.abstract_max_stable_model import AbstractMaxStableModel
from extreme_estimator.extreme_models.margin_model.abstract_margin_model import AbstractMarginModel
from extreme_estimator.extreme_models.max_stable_model.abstract_max_stable_model import AbstractMaxStableModel
from spatio_temporal_dataset.dataset.abstract_dataset import AbstractDataset
from spatio_temporal_dataset.spatial_coordinates.abstract_spatial_coordinates import AbstractSpatialCoordinates
from spatio_temporal_dataset.temporal_observations.abstract_temporal_observations import AbstractTemporalObservations
......
......@@ -2,7 +2,7 @@ import math
import numpy as np
import pandas as pd
from extreme_estimator.R_model.utils import get_loaded_r
from extreme_estimator.extreme_models.utils import get_loaded_r
from spatio_temporal_dataset.spatial_coordinates.abstract_spatial_coordinates import AbstractSpatialCoordinates
import matplotlib.pyplot as plt
......
import pandas as pd
from extreme_estimator.R_model.margin_model.abstract_margin_model import AbstractMarginModel
from extreme_estimator.R_model.max_stable_model.abstract_max_stable_model import AbstractMaxStableModel
from extreme_estimator.extreme_models.margin_model.abstract_margin_model import AbstractMarginModel
from extreme_estimator.extreme_models.max_stable_model.abstract_max_stable_model import AbstractMaxStableModel
from spatio_temporal_dataset.spatial_coordinates.abstract_spatial_coordinates import AbstractSpatialCoordinates
from spatio_temporal_dataset.temporal_observations.abstract_temporal_observations import AbstractTemporalObservations
......
......@@ -2,8 +2,8 @@ import unittest
import numpy as np
from extreme_estimator.R_model.gev.gev_mle_fit import GevMleFit
from extreme_estimator.R_model.utils import get_loaded_r
from extreme_estimator.gev.gev_mle_fit import GevMleFit
from extreme_estimator.extreme_models.utils import get_loaded_r
class TestGevMleFit(unittest.TestCase):
......
import unittest
from extreme_estimator.R_model.gev.gev_parameters import GevParams
from extreme_estimator.R_model.margin_function.independent_margin_function import LinearMarginFunction
from extreme_estimator.R_model.margin_model.smooth_margin_model import ConstantMarginModel, LinearShapeAxis0MarginModel
from extreme_estimator.gev_params import GevParams
from extreme_estimator.extreme_models.margin_model.smooth_margin_model import LinearShapeAxis0MarginModel
from spatio_temporal_dataset.spatial_coordinates.generated_coordinates import CircleCoordinatesRadius1
class TestLinearMarginModel(unittest.TestCase):
DISPLAY = True
DISPLAY = False
def test_visualization_2D(self):
spatial_coordinates = CircleCoordinatesRadius1.from_nb_points(nb_points=50)
......
import unittest
from extreme_estimator.R_model.margin_model.abstract_margin_model import AbstractMarginModel
from extreme_estimator.R_model.margin_model.smooth_margin_model import ConstantMarginModel
from extreme_estimator.extreme_models.margin_model.abstract_margin_model import AbstractMarginModel
from extreme_estimator.extreme_models.margin_model.smooth_margin_model import ConstantMarginModel
from extreme_estimator.estimator.margin_estimator import SmoothMarginEstimator
from spatio_temporal_dataset.dataset.simulation_dataset import MarginDataset
from spatio_temporal_dataset.spatial_coordinates.generated_coordinates import CircleCoordinatesRadius1
......
import unittest
from extreme_estimator.R_model.max_stable_model.abstract_max_stable_model import \
from extreme_estimator.extreme_models.max_stable_model.abstract_max_stable_model import \
AbstractMaxStableModelWithCovarianceFunction, CovarianceFunction
from extreme_estimator.R_model.max_stable_model.max_stable_models import Smith, BrownResnick, Schlather, \
from extreme_estimator.extreme_models.max_stable_model.max_stable_models import Smith, BrownResnick, Schlather, \
Geometric, ExtremalT, ISchlather
from extreme_estimator.estimator.max_stable_estimator import MaxStableEstimator
from spatio_temporal_dataset.dataset.simulation_dataset import MaxStableDataset
......
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