diff --git a/extreme_estimator/extreme_models/max_stable_model/max_stable_models.py b/extreme_estimator/extreme_models/max_stable_model/max_stable_models.py index 1835c6a59e6eb0ba54ec8b14cb62d5a5bcca35e0..812a7a949e6d21d9d22100860e39f0e8944fc0ab 100644 --- a/extreme_estimator/extreme_models/max_stable_model/max_stable_models.py +++ b/extreme_estimator/extreme_models/max_stable_model/max_stable_models.py @@ -10,6 +10,7 @@ class Smith(AbstractMaxStableModel): super().__init__(params_start_fit=params_start_fit, params_sample=params_sample) self.cov_mod = 'gauss' self.default_params_start_fit = { + 'var': 1, 'cov11': 1, 'cov12': 0, 'cov22': 1 diff --git a/test/test_spatio_temporal_dataset/test_dataset.py b/test/test_spatio_temporal_dataset/test_dataset.py index 320d68778beec576269c7576185453071cced40b..f19f40b68e96ed29433de47e2e35596816feda49 100644 --- a/test/test_spatio_temporal_dataset/test_dataset.py +++ b/test/test_spatio_temporal_dataset/test_dataset.py @@ -1,10 +1,33 @@ +from rpy2.rinterface import RRuntimeError import unittest +from itertools import product + +from extreme_estimator.extreme_models.max_stable_model.utils import load_max_stable_models +from spatio_temporal_dataset.coordinates.utils import load_coordinates +from spatio_temporal_dataset.dataset.simulation_dataset import MaxStableDataset class TestDataset(unittest.TestCase): - pass - # already done by the estimator somehow, - # maybe I could add some more precise test that check for 1D, 2D and 3D Datasets + nb_obs = 10 + nb_points = 10 + + def test_max_stable_dataset_R1_and_R2(self): + max_stable_models = load_max_stable_models()[:] + coordinatess = load_coordinates(self.nb_points)[:-1] + for coordinates, max_stable_model in product(coordinatess, max_stable_models): + MaxStableDataset.from_sampling(nb_obs=self.nb_obs, + max_stable_model=max_stable_model, + coordinates=coordinates) + self.assertTrue(True) + + def test_max_stable_dataset_crash_R3(self): + # test to warn me when spatialExtremes handles R3 + with self.assertRaises(RRuntimeError): + smith_process = load_max_stable_models()[0] + coordinates_R3 = load_coordinates(self.nb_points)[-1] + MaxStableDataset.from_sampling(nb_obs=self.nb_obs, + max_stable_model=smith_process, + coordinates=coordinates_R3) if __name__ == '__main__':