Fits candidate parametric distributions to each column of X by
maximum likelihood and selects the best fit using AIC or BIC, following
the methodology in Clavijo Mesa et al. (2026).
Value
A data.frame with one row per cell and columns cell_id,
best_dist, best_dist_label, params, loglik,
aic, bic, n_obs, n_failed,
conv_code (0 = converged, see ?optim), and n_iter
(number of function evaluations by the optimiser). The attribute
"fits_full" stores raw per-cell fit results for use in
[hm_marginal_gof()].
Examples
f <- system.file("extdata", "Copernicus_dailymax_1994_2021.nc",
package = "HazardMaps")
x <- hm_read_netcdf(f, var = "i10fg")
x <- hm_standardize_coords(x)
x <- hm_decode_time(x)
x_ext <- hm_select_extreme_events(x, threshold = 25)
X <- hm_to_matrix(x_ext)
if (FALSE) { # \dontrun{
fits <- hm_fit_marginals(X, criterion = "bic")
table(fits$best_dist)
} # }
