def __init__(self, *args, **kwargs): super(GumbelTest, self).__init__(*args, **kwargs) self.datasets = [ portpirie().fields.sea_level, fremantle().fields.sea_level ] # The following values are obtained using ismev and extRemes R # packages self.expected_mle_params = [(0, 3.8694, 0.1949), (0, 1.4663, 0.1394)] self.expected_mle_nnlf = [-4.2177, -39.1909] self.expected_mle_se = [(0.02549, 0.01885), (0.01593, 0.01084)] # The following values are obtained using lmom R package self.expected_lmom_params = [(0, 3.8685, 0.1943), (0, 1.4690, 0.1195)]
def __init__(self, *args, **kwargs): super(GumbelTest, self).__init__(*args, **kwargs) self.datasets = [portpirie().fields.sea_level, fremantle().fields.sea_level] # The following values are obtained using ismev and extRemes R # packages self.expected_mle_params = [(0, 3.8694, 0.1949), (0, 1.4663, 0.1394)] self.expected_mle_nnlf = [-4.2177, -39.1909] self.expected_mle_se = [(0.02549, 0.01885), (0.01593, 0.01084)] # The following values are obtained using lmom R package self.expected_lmom_params = [(0, 3.8685, 0.1943), (0, 1.4690, 0.1195)]
def __init__(self, *args, **kwargs): super(GEVTest, self).__init__(*args, **kwargs) self.datasets = [portpirie().fields.sea_level, fremantle().fields.sea_level] # The following values are obtained using ismev and extRemes R # packages self.expected_mle_params = [(-0.0501, 3.8747, 0.1980), (-0.2174, 1.4823, 0.1413)] self.expected_mle_nnlf = [-4.3391, -43.5667] self.expected_mle_se = [(0.09826, 0.02793, 0.02025), (0.06377, 0.01671, 0.01149)] # The following values are obtained using extRemes R package self.expected_lmom_params = [(-0.0515, 3.8732, 0.2031), (-0.1963, 1.4807, 0.1391)]
def __init__(self, *args, **kwargs): super(GEVTest, self).__init__(*args, **kwargs) self.datasets = [ portpirie().fields.sea_level, fremantle().fields.sea_level ] # The following values are obtained using ismev and extRemes R # packages self.expected_mle_params = [(-0.0501, 3.8747, 0.1980), (-0.2174, 1.4823, 0.1413)] self.expected_mle_nnlf = [-4.3391, -43.5667] self.expected_mle_se = [(0.09826, 0.02793, 0.02025), (0.06377, 0.01671, 0.01149)] # The following values are obtained using extRemes R package self.expected_lmom_params = [(-0.0515, 3.8732, 0.2031), (-0.1963, 1.4807, 0.1391)]
""" Tests for classic module """ import pytest from numpy.testing import assert_almost_equal, assert_array_almost_equal from skextremes.models.classic import GEV, Gumbel from skextremes.datasets import portpirie, fremantle # Datasets to be used datasets = [portpirie().fields.sea_level, fremantle().fields.sea_level] # Expected results for GEV # The following values are obtained using ismev and extRemes R packages expected_mle_params = [(-0.0501, 3.8747, 0.1980), (-0.2174, 1.4823, 0.1413)] expected_mle_nnlf = [-4.3391, -43.5667] expected_mle_se = [(0.09826, 0.02793, 0.02025), (0.06377, 0.01671, 0.01149)] # The following values are obtained using extRemes R package expected_lmom_params = [(-0.0515, 3.8732, 0.2031), (-0.1963, 1.4807, 0.1391)] class TestGEV: @pytest.mark.parametrize( "data, params, nnlf, se", [(d, p, n, s) for d, p, n, s in zip( datasets, expected_mle_params, expected_mle_nnlf, expected_mle_se, )], )