fit_map
fit_map(
model,
distribution=None,
optimizer='NelderMead',
hessian=True,
profile=False,
profile_bins=100,
)Maximum a posteriori fit.
Fit a model by maximum a posteriori (the mode of the posterior formed from the model’s own priors) and return a fit carrying the parameter estimates, the Hessian-based covariance, and optimizer bookkeeping. Wraps the shared C++ MaximumAPosteriori ported from USACE-RMC RMC.BestFit.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| model | Model or array_like | See :func:fit_mle. |
required |
| distribution | str | See :func:fit_mle. |
None |
| optimizer | str | See :func:fit_mle. |
"NelderMead" |
| hessian | bool | See :func:fit_mle. |
True |
| profile | bool | See :func:fit_mle. |
False |
| profile_bins | int | See :func:fit_mle. |
100 |
Returns
| Name | Type | Description |
|---|---|---|
| Fit | See :func:fit_mle. |
See Also
fit_mle, fit_bayesian, fit_gmm, fit_diagnostics
Examples
>>> from corehydropy import fit_map, model_univariate
>>> peaks = [12500, 15300, 8900, 22100, 18700, 14200, 9800, 28500, 17400, 11600]
>>> f = fit_map(model_univariate("LogPearsonTypeIII", peaks))
>>> sorted(f.parameters)