The estimation Module

stat_fem.estimation.estimate_params_MAP(A, b, G, data, priors=[None, None, None], start=None, ensemble_comm=<Mock name='mock.COMM_SELF' id='140051716830736'>, **kwargs)

Estimate model hyperparameters using MAP estimation

This function uses maximum a posteriori estimation to fit parameters for a Statistical FEM model. The function is a wrapper to the Scipy LBFGS function to minimize the marginal log posterior, returning a fit LinearSolver object. This allows re-use of the cached Forcing Covariance function solves for each sensor, which greatly improves efficiency of the computation.

Priors on the three hyperparameters can be specified by passing a list of Prior-derived objects. The priors are over the values as passed directly to all functions (i.e. while still on a logarithmic scale). If no priors are provided, then an uninformative prior is assumed and estimation is based on the marginal log-likelihood.

The computations to solve for the forcing covariance can be carried out in parallel by passing a Firedrake Ensemble communicator for the ensemble_comm keyword argument. All other computations are done on the root process and broadcast to all other processes to ensure that all processes have the same final minimum value when the computation terminates.

Additional keyword arguments can be passed to control the minimization routine options or the PETSc solver options. These will be forwarded to the function calls to scipy.optimize.minimize or LinearSolver. See the documentation for minimize or LinearSolver for more details.

Parameters:
  • A (Matrix) – FEM stiffness matrix, must be a Firedrake Matrix class.
  • b (Function or Vector) – FEM RHS vector, must be a Firedrake Function or Vector
  • G (ForcingCovariance) – Forcing Covariance matrix, must be a ForcingCovariance class.
  • data (ObsData) – Observational data object, must be a ObsData class.
  • priors (list) – List of prior objects over hyperparameters. Must be a list of length 3 containing Prior-derived objects or None for uninformative priors. Optional, default is [None, None, None] (uninformative priors on all parameters).
  • start (None or ndarray) – Starting point for minimization routine. Must be a numpy array of length 3 or None if the starting point is to be drawn randomly. Optional, default is None.
  • ensemble_comm – MPI communicator for ensemble parallelism created from a Firedrake Ensemble object. This controls how the solves over all sensors are parallelized. Optional, default value is COMM_SELF indicating that forcing covariance solves are not parallelized.
  • kwargs – Additional keyword arguments to be passed to either the Firedrake LinearSolver object or the Scipy minimize routine. See the corresponding manuals for more information.
Returns:

A LinearSolver object with the hyperparameters set to the MAP/MLE value. To extract the actual parameters, use the params attribute.

Return type:

LinearSolver