kipe.estimation module
Parameter estimation with the ROUKF: kipe estimation.
Estimation runs the reduced-order unscented Kalman filter (kipe.roukf) over a
set of measurements: at each measurement time, the sigma points are propagated with the
forward solver, compared with the data of the measurements at that time through their
observation operators, and the estimate is corrected. The measurements may have different
times; the filter steps through all of them in order. Outer iterations repeat the pass,
continuing from the previous estimate with the spread reset to the prior standard deviation.
estimate() builds all of this from a study file.
The estimation history is written to <output.path>/estimation/: history.csv (one row
per assimilation step, written as the filter runs) and history.npz (all steps of the
completed outer iterations, including the full parameter covariance, written after each). An
interrupted estimation can continue from it (kipe estimation --resume). estimate()
also writes the provenance of the run there (kipe.provenance). With several noise
realizations (synthesis.realizations), each estimation uses the data of one realization
and writes to its subdirectory, e.g., estimation/r07/.
- class kipe.estimation.Estimation(solver: ForwardSolver, parameterization: Parameterization, measurements: list[Measurement], options: EstimationOptions, output: Path, comm: mpi4py.MPI.Comm = mpi4py.MPI.COMM_WORLD, completed_steps: Sequence[Step] = ())[source]
Bases:
objectParameter estimation with the ROUKF over a set of measurements.
- Parameters:
solver – the forward solver
parameterization – the estimated parameters, with their initial estimate and uncertainty
measurements – the measurements, with distinct names; each at its own times, those at the same time (up to round-off) are assimilated together
options – number of outer iterations and sigma-point stencil
output – directory for the estimation history
comm – communicator over which the model state is distributed
completed_steps – the steps of the completed outer iterations of an earlier, interrupted run of the same estimation, which this one continues
- Raises:
ValueError – if two measurements have the same name
StudyFileError – if a measurement has two times that are the same up to round-off
- property times: list[float]
the times of all measurements, in order.
- Type:
The assimilation times
- run() Parameters[source]
Run the outer iterations, each a pass of the filter over all measurements.
Each pass after the first starts from the previous estimate, with the initial uncertainty. After each pass, the history is written to
history.npz. A run that continues an earlier one starts after its completed iterations, from their estimate.- Returns:
the estimated parameters, as physical values
- kipe.estimation.estimate(study: StudyOptions, comm: mpi4py.MPI.Comm = mpi4py.MPI.COMM_WORLD, realization: int = 0, resume: bool = False) Parameters[source]
Estimate the parameters of a study; write the estimation history and the provenance.
Builds the forward solver, the estimated parameters and the measurements (with their data) from the study file, then runs the
Estimation.With
resume, an interrupted estimation continues after its completed outer iterations, as recorded in itshistory.npz, with the same result as without the interruption. The study may have moreestimation.iterationsthan before, but must otherwise be the same. Without a history, the estimation starts from the beginning; if it is complete, nothing runs.- Parameters:
study – the study options
comm – communicator over which the model state is distributed
realization – number of the noise realization whose data are used (
synthesis.realizations)resume – continue an interrupted estimation
- Returns:
the estimated parameters, as physical values
- Raises:
StudyFileError – if the study lacks what estimation needs, has no such realization, or the data do not fit; with
resume, if the study has changed since the earlier run