Commit 220ade60 authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[contrasting] modify nllh code. and nb_params for gumbel models.

parent a6d4a66a
No related merge requests found
Showing with 5 additions and 1 deletion
+5 -1
......@@ -55,7 +55,7 @@ class LinearMarginEstimator(AbstractMarginEstimator):
assert len(
maximum) == 1, 'So far, only one observation for each coordinate, but code would be easy to change'
maximum = maximum[0]
gev_params = self.function_from_fit.get_params(coordinate, is_transformed=False)
gev_params = self.function_from_fit.get_params(coordinate, is_transformed=True)
p = gev_params.density(maximum)
nllh -= np.log(p)
assert not np.isinf(nllh)
......
......@@ -126,6 +126,10 @@ class GumbelTemporalModel(StationaryTemporalModel):
super().__init__(coordinates, params_user, starting_point, fit_method,
nb_iterations_for_bayesian_fit, params_initial_fit_bayesian, type_for_MLE="Gumbel")
@property
def nb_params(self):
return super().nb_params - 1
class NonStationaryLocationGumbelModel(GumbelTemporalModel, NonStationaryLocationTemporalModel):
pass
......
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